mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02: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
@ -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.
|
||||
if ( typeof x === 'number' ) {
|
||||
const magicAttr = `${vAPI.sessionId}-clickblind`;
|
||||
pickerRoot.setAttribute(magicAttr, '');
|
||||
const elems = elementsFromPoint(document, x, y);
|
||||
const elems = document.elementsFromPoint(x, y);
|
||||
pickerRoot.removeAttribute(magicAttr);
|
||||
if ( typeof x === 'number' ) {
|
||||
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 New Issue
Block a user