mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
Improve logging in prevent-addEventListener
scriptlet
Related feedback: https://github.com/uBlockOrigin/uAssets/discussions/17907#discussioncomment-9871079
This commit is contained in:
parent
88065d0091
commit
8eb3b19c69
1 changed files with 3 additions and 1 deletions
|
@ -1661,7 +1661,9 @@ function addEventListenerDefuser(
|
||||||
if ( elem instanceof Document ) { return 'document'; }
|
if ( elem instanceof Document ) { return 'document'; }
|
||||||
if ( elem instanceof Element === false ) { return '?'; }
|
if ( elem instanceof Element === false ) { return '?'; }
|
||||||
const parts = [];
|
const parts = [];
|
||||||
if ( elem.id !== '' ) { parts.push(`#${CSS.escape(elem.id)}`); }
|
// https://github.com/uBlockOrigin/uAssets/discussions/17907#discussioncomment-9871079
|
||||||
|
const id = String(elem.id);
|
||||||
|
if ( id !== '' ) { parts.push(`#${CSS.escape(id)}`); }
|
||||||
for ( let i = 0; i < elem.classList.length; i++ ) {
|
for ( let i = 0; i < elem.classList.length; i++ ) {
|
||||||
parts.push(`.${CSS.escape(elem.classList.item(i))}`);
|
parts.push(`.${CSS.escape(elem.classList.item(i))}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue