mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-05 18:32:30 +01:00
Ensure that typeof of href attribute is string
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/777
This commit is contained in:
parent
71f3b07eef
commit
067ef5843c
@ -1429,11 +1429,10 @@ vAPI.bootstrap = (function() {
|
||||
// https://github.com/chrisaljoudi/uBlock/issues/1143
|
||||
// Find a link under the mouse, to try to avoid confusing new tabs
|
||||
// as nuisance popups.
|
||||
let elem = ev.target;
|
||||
while ( elem !== null && elem.localName !== 'a' ) {
|
||||
elem = elem.parentElement;
|
||||
}
|
||||
if ( elem === null ) { return; }
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/777
|
||||
// Mind that href may not be a string.
|
||||
const elem = ev.target.closest('a[href]');
|
||||
if ( elem === null || typeof elem.href !== 'string' ) { return; }
|
||||
vAPI.messaging.send('contentscript', {
|
||||
what: 'maybeGoodPopup',
|
||||
url: elem.href || '',
|
||||
|
Loading…
Reference in New Issue
Block a user