mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-05-05 21:03:17 +12:00
Add more cases for documentUrl to be safely used as root context
Related issue: - https://github.com/uBlockOrigin/uMatrix-issues/issues/155
This commit is contained in:
parent
d5fe3edb15
commit
c3919da2c2
|
@ -205,9 +205,11 @@ var onBeforeSendHeadersHandler = function(details) {
|
|||
// https://github.com/uBlockOrigin/uMatrix-issues/issues/155
|
||||
// https://github.com/uBlockOrigin/uMatrix-issues/issues/159
|
||||
// TODO: import all filtering context improvements from uBO.
|
||||
const srcHn = tabId >= 0
|
||||
? pageStore.pageHostname
|
||||
: µmuri.hostnameFromURI(details.documentUrl) || pageStore.pageHostname;
|
||||
const srcHn = tabId < 0 ||
|
||||
details.parentFrameId < 0 ||
|
||||
details.parentFrameId === 0 && details.type === 'sub_frame'
|
||||
? µmuri.hostnameFromURI(details.documentUrl) || pageStore.pageHostname
|
||||
: pageStore.pageHostname;
|
||||
|
||||
// https://github.com/gorhill/httpswitchboard/issues/342
|
||||
// Is this hyperlink auditing?
|
||||
|
|
Loading…
Reference in a new issue