From 26aedcc5f98fdfe639c2341884966ca7cb6c27a2 Mon Sep 17 00:00:00 2001 From: xofe <22776566+xofe@users.noreply.github.com> Date: Sun, 7 Apr 2019 13:27:55 +0000 Subject: [PATCH] show placeholder for blocked `frame` elements (fix https://github.com/uBlockOrigin/uMatrix-issues/issues/120) (#1010) --- src/js/contentscript.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index 3757da9..7ad0be8 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -124,6 +124,7 @@ var collapser = (function() { reURLPlaceholder = /\{\{url\}\}/g; var src1stProps = { 'embed': 'src', + 'frame': 'src', 'iframe': 'src', 'img': 'src', 'object': 'data' @@ -133,6 +134,7 @@ var collapser = (function() { }; var tagToTypeMap = { embed: 'media', + frame: 'frame', iframe: 'frame', img: 'image', object: 'media' @@ -187,6 +189,7 @@ var collapser = (function() { continue; } switch ( tag ) { + case 'frame': case 'iframe': if ( placeholders.frame !== true ) { break; } let docurl = @@ -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')); } } }; @@ -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(); })();