# HG changeset patch # User nanaya # Date 1557063370 -32400 # Node ID cd3ffdc3161357a267cdd69fa9562a800101149a # Parent 3381a9cb88d1453c998fba6f2d1976cf5f9d4b35 Better null check diff -r 3381a9cb88d1 -r cd3ffdc31613 tweetdeck-large-image.user.js --- a/tweetdeck-large-image.user.js Thu Aug 23 22:58:33 2018 +0900 +++ b/tweetdeck-large-image.user.js Sun May 05 22:36:10 2019 +0900 @@ -1,7 +1,7 @@ // ==UserScript== // @name Tweetdeck large image // @namespace https://myconan.net -// @version 2.0.1 +// @version 2.0.2 // @description No more stupid link for images in tweetdeck // @author nanaya // @match https://tweetdeck.twitter.com/* @@ -14,7 +14,7 @@ // loop through passed nodes (or body if called without arguments) var run = function(nodes) { - if (nodes === undefined) { + if (nodes == null) { nodes = [document.body]; } @@ -46,7 +46,7 @@ var image = link.querySelector(".media-img"); var url; - if (image === null) { + if (image == null) { // sometimes the image is just background image of the link. // strip all query strings and original :size suffix url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(?::small)?(?:\?.*)?\1\)$/, "$2");