1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-01 16:33:06 +01:00

Fix highlighting nodes for net filters in element-picker

This commit is contained in:
Deathamns 2015-02-10 16:50:47 +01:00
parent 187355b2b2
commit 2d507b3edc

View File

@ -271,6 +271,7 @@ var netFilterFromElement = function(elem, out) {
};
var netFilterSources = {
'embed': 'src',
'iframe': 'src',
'img': 'src',
'object': 'data'
@ -410,15 +411,16 @@ var elementsFromFilter = function(filter) {
if ( filter.slice(0, 2) === '||' ) {
filter = filter.replace('||', '');
}
var elems = document.querySelectorAll('iframe,img,object');
var elems = document.querySelectorAll('iframe, img, object, embed');
var i = elems.length;
var elem, src;
while ( i-- ) {
elem = elems[i];
src = elem.getAttribute(netFilterSources[elem.tagName.toLowerCase()]);
src = elem[netFilterSources[elem.tagName.toLowerCase()]];
if ( typeof src !== 'string' ) {
continue;
}
if ( src.indexOf(filter) !== -1 ) {
out.push(elem);
}
@ -752,6 +754,7 @@ var startPicker = function(details) {
'a': 'href',
'img': 'src',
'iframe': 'src',
'embed': 'src',
'video': 'src',
'audio': 'src'
};