Extend pseudo-elements support byond `::before`/`::after`

Related feedback:
- https://github.com/uBlockOrigin/uAssets/issues/6069#issuecomment-520254292
This commit is contained in:
Raymond Hill 2019-08-11 16:32:49 -04:00
parent aa85cddb7b
commit 2c39a1af02
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ const loggedSelectors = new Set();
/******************************************************************************/ /******************************************************************************/
const rePseudoElements = /::?(?:after|before)$/; const rePseudoElements = /:(?::?after|:?before|:[a-z-]+)$/;
const safeMatchSelector = function(selector, context) { const safeMatchSelector = function(selector, context) {
const safeSelector = rePseudoElements.test(selector) const safeSelector = rePseudoElements.test(selector)

View File

@ -698,7 +698,7 @@ const filtersFrom = function(x, y) {
const filterToDOMInterface = (( ) => { const filterToDOMInterface = (( ) => {
const reHnAnchorPrefix = '^[\\w-]+://(?:[^/?#]+\\.)?'; const reHnAnchorPrefix = '^[\\w-]+://(?:[^/?#]+\\.)?';
const reCaret = '(?:[^%.0-9a-z_-]|$)'; const reCaret = '(?:[^%.0-9a-z_-]|$)';
const rePseudoElements = /::?(?:after|before)$/; const rePseudoElements = /:(?::?after|:?before|:[a-z-]+)$/;
// Net filters: we need to lookup manually -- translating into a foolproof // Net filters: we need to lookup manually -- translating into a foolproof
// CSS selector is just not possible. // CSS selector is just not possible.