Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
show placeholder for blocked frame elements (fix uBlockOrigin/uMatr…
Browse files Browse the repository at this point in the history
  • Loading branch information
xofe authored and gorhill committed Apr 7, 2019
1 parent 6f38e88 commit 49040b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ var collapser = (function() {
reURLPlaceholder = /\{\{url\}\}/g;
var src1stProps = {
'embed': 'src',
'frame': 'src',
'iframe': 'src',
'img': 'src',
'object': 'data'
Expand All @@ -133,6 +134,7 @@ var collapser = (function() {
};
var tagToTypeMap = {
embed: 'media',
frame: 'frame',
iframe: 'frame',
img: 'image',
object: 'media'
Expand Down Expand Up @@ -187,6 +189,7 @@ var collapser = (function() {
continue;
}
switch ( tag ) {
case 'frame':
case 'iframe':
if ( placeholders.frame !== true ) { break; }
let docurl =
Expand Down Expand Up @@ -321,11 +324,11 @@ var collapser = (function() {
while ( i-- ) {
node = nodeList[i];
if ( node.nodeType !== 1 ) { continue; }
if ( node.localName === 'iframe' ) {
if ( node.localName === 'iframe' || node.localName === 'frame' ) {
addIFrame(node);
}
if ( node.childElementCount !== 0 ) {
addIFrames(node.querySelectorAll('iframe'));
addIFrames(node.querySelectorAll('iframe, frame'));
}
}
};
Expand Down Expand Up @@ -456,7 +459,7 @@ var collapser = (function() {
}

collapser.addMany(document.querySelectorAll('img'));
collapser.addIFrames(document.querySelectorAll('iframe'));
collapser.addIFrames(document.querySelectorAll('iframe, frame'));
collapser.process();
})();

Expand Down

0 comments on commit 49040b4

Please sign in to comment.