From 6f7801d433dc4df4a5ba1704cb4d2105c8ed4c79 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 9 Sep 2020 10:51:30 -0400 Subject: [PATCH] Fix zapper not being able to remove SVG elements Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1237 --- src/js/epicker-ui.js | 1 - src/js/scriptlets/epicker.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/epicker-ui.js b/src/js/epicker-ui.js index 295974d9f..d0924881c 100644 --- a/src/js/epicker-ui.js +++ b/src/js/epicker-ui.js @@ -150,7 +150,6 @@ const candidateFromFilterChoice = function(filterChoice) { return filter; } - // TODO: Maybe add another step to remove attribute values? const specificity = [ 0b0000, // remove hierarchy; remove id, nth-of-type, attribute values 0b0010, // remove hierarchy; remove id, nth-of-type diff --git a/src/js/scriptlets/epicker.js b/src/js/scriptlets/epicker.js index b32488faa..188cfe854 100644 --- a/src/js/scriptlets/epicker.js +++ b/src/js/scriptlets/epicker.js @@ -898,7 +898,7 @@ const zapElementAtPoint = function(mx, my, options) { elem = elementFromPoint(mx, my); } - if ( elem instanceof HTMLElement === false ) { return; } + if ( elem instanceof Element === false ) { return; } const getStyleValue = function(elem, prop) { const style = window.getComputedStyle(elem);