mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-01 08:39:37 +02:00
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:
parent
9183e42a40
commit
d5dcf4e9b6
@ -267,7 +267,7 @@ const resourceURLsFromElement = function(elem) {
|
|||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1071
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/1071
|
||||||
const resourceURLsFromSrcset = function(elem, out) {
|
const resourceURLsFromSrcset = function(elem, out) {
|
||||||
let srcset = elem.srcset;
|
let srcset = elem.srcset;
|
||||||
if ( typeof srcset !== 'string' && srcset === '' ) { return; }
|
if ( typeof srcset !== 'string' || srcset === '' ) { return; }
|
||||||
for(;;) {
|
for(;;) {
|
||||||
// trim whitespace
|
// trim whitespace
|
||||||
srcset = srcset.trim();
|
srcset = srcset.trim();
|
||||||
|
Loading…
Reference in New Issue
Block a user