Skip to content

Commit

Permalink
Improve prevent-addEventListener scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 11, 2024
1 parent 79c2eec commit 91ee5bd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,8 @@ function addEventListenerDefuser(
const debug = shouldDebug(extraArgs);
const targetSelector = extraArgs.elements || undefined;
const elementMatches = elem => {
if ( targetSelector === 'window' ) { return elem === window; }
if ( targetSelector === 'document' ) { return elem === document; }
if ( elem && elem.matches && elem.matches(targetSelector) ) { return true; }
const elems = Array.from(document.querySelectorAll(targetSelector));
return elems.includes(elem);
Expand Down
2 changes: 1 addition & 1 deletion platform/mv3/extension/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"description": "Label for a checkbox in the options page"
},
"showBlockedCountLabel": {
"message": "在工具栏图标上显示已拦截的请求数",
"message": "在工具栏图标上显示拦截请求数",
"description": "Label for a checkbox in the options page"
}
}
2 changes: 1 addition & 1 deletion src/_locales/be/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "extension name."
},
"extShortDesc": {
"message": "Нарэшце, эфектыўны блакіроўшчык. Не нагружае працэсар і памяць.",
"message": "Нарэшце, эфектыўны блакавальнік. Не нагружае працэсар і памяць.",
"description": "this will be in the Chrome web store: must be 132 characters or less"
},
"dashboardName": {
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/eu/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
"description": "Warning against copy-pasting filters from random sources"
},
"1pEnableMyFiltersLabel": {
"message": "Enable my custom filters",
"message": "Aktibatu nire filtro pertsonalitsatuak",
"description": "Label for the checkbox use to enable/disable 'My filters' list"
},
"1pTrustMyFiltersLabel": {
Expand Down

0 comments on commit 91ee5bd

Please sign in to comment.