Fix improper handling of srcset in element picker

Regression from:
- 16727d68c8

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
This commit is contained in:
Raymond Hill 2020-07-13 11:46:38 -04:00
parent 9183e42a40
commit d5dcf4e9b6
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 1 deletions

View File

@ -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();