From d5dcf4e9b6cda8108d2baf4d6bfd7f96e74dae69 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 13 Jul 2020 11:46:38 -0400 Subject: [PATCH] Fix improper handling of srcset in element picker Regression from: - https://github.com/gorhill/uBlock/commit/16727d68c8c73245f78ab247f9ec86ac63edfd30 The issue was causing the element picker to being unable to select elements with no valid `srcset` property. Test case -- trying to select one of the embedded frames in the following page would fail: - http://raymondhill.net/ublock/tiles1.html --- src/js/scriptlets/element-picker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/scriptlets/element-picker.js b/src/js/scriptlets/element-picker.js index 895df9714..362f07c10 100644 --- a/src/js/scriptlets/element-picker.js +++ b/src/js/scriptlets/element-picker.js @@ -267,7 +267,7 @@ const resourceURLsFromElement = function(elem) { // https://github.com/uBlockOrigin/uBlock-issues/issues/1071 const resourceURLsFromSrcset = function(elem, out) { let srcset = elem.srcset; - if ( typeof srcset !== 'string' && srcset === '' ) { return; } + if ( typeof srcset !== 'string' || srcset === '' ) { return; } for(;;) { // trim whitespace srcset = srcset.trim();