Skip to content

Commit

Permalink
Improve logging in prevent-addEventListener scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 25, 2024
1 parent 88065d0 commit 8eb3b19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,9 @@ function addEventListenerDefuser(
if ( elem instanceof Document ) { return 'document'; }
if ( elem instanceof Element === false ) { return '?'; }
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++ ) {
parts.push(`.${CSS.escape(elem.classList.item(i))}`);
}
Expand Down

0 comments on commit 8eb3b19

Please sign in to comment.