mirror of https://github.com/gorhill/uBlock.git
Extend pseudo-elements support byond `::before`/`::after`
Related feedback: - https://github.com/uBlockOrigin/uAssets/issues/6069#issuecomment-520254292
This commit is contained in:
parent
aa85cddb7b
commit
2c39a1af02
|
@ -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)
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue