mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Undo mistakenly committed changes to the element picker
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2360
This commit is contained in:
parent
502fcee546
commit
4a01affa0e
1 changed files with 7 additions and 20 deletions
|
|
@ -113,16 +113,6 @@ const getElementBoundingClientRect = function(elem) {
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
const elementsFromPoint = function(parent, x, y) {
|
||||
const elems = parent.elementsFromPoint(x, y);
|
||||
if ( elems.length !== 0 && elems[0].shadowRoot !== null ) {
|
||||
return elementsFromPoint(elems[0].shadowRoot, x, y);
|
||||
}
|
||||
return elems;
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
const highlightElements = function(elems, force) {
|
||||
// To make mouse move handler more efficient
|
||||
if (
|
||||
|
|
@ -564,11 +554,11 @@ const filtersFrom = function(x, y) {
|
|||
// Network filter candidates from all other elements found at [x,y].
|
||||
// https://www.reddit.com/r/uBlockOrigin/comments/qmjk36/
|
||||
// Extract network candidates first.
|
||||
const magicAttr = `${vAPI.sessionId}-clickblind`;
|
||||
pickerRoot.setAttribute(magicAttr, '');
|
||||
const elems = elementsFromPoint(document, x, y);
|
||||
pickerRoot.removeAttribute(magicAttr);
|
||||
if ( typeof x === 'number' ) {
|
||||
const magicAttr = `${vAPI.sessionId}-clickblind`;
|
||||
pickerRoot.setAttribute(magicAttr, '');
|
||||
const elems = document.elementsFromPoint(x, y);
|
||||
pickerRoot.removeAttribute(magicAttr);
|
||||
for ( const elem of elems ) {
|
||||
netFilterFromElement(elem);
|
||||
}
|
||||
|
|
@ -580,14 +570,11 @@ const filtersFrom = function(x, y) {
|
|||
// https://github.com/gorhill/uBlock/issues/2519
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/17
|
||||
// Prepend `body` if full selector is ambiguous.
|
||||
for ( const elem of elems ) {
|
||||
let elem = first;
|
||||
while ( elem && elem !== document.body ) {
|
||||
cosmeticFilterFromElement(elem);
|
||||
elem = elem.parentNode;
|
||||
}
|
||||
//let elem = first;
|
||||
//while ( elem && elem !== document.body ) {
|
||||
// cosmeticFilterFromElement(elem);
|
||||
// elem = elem.parentNode;
|
||||
//}
|
||||
// The body tag is needed as anchor only when the immediate child
|
||||
// uses `nth-of-type`.
|
||||
let i = cosmeticFilterCandidates.length;
|
||||
|
|
|
|||
Loading…
Reference in a new issue