mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Improve reporting of reason option in strict-blocked pages
Related feedback: https://github.com/uBlockOrigin/uBlock-issues/issues/1195#issuecomment-3072981070
This commit is contained in:
parent
1e955bebbe
commit
b7510eee61
3 changed files with 16 additions and 10 deletions
|
|
@ -73,7 +73,7 @@ a {
|
|||
}
|
||||
#theURL > p > span:first-of-type {
|
||||
display: block;
|
||||
max-height: 6lh;
|
||||
max-height: 3lh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
:root.mobile #theURL > p > span:first-of-type {
|
||||
|
|
@ -146,6 +146,7 @@ details > *:not(summary) {
|
|||
|
||||
#urlskip a {
|
||||
display: block;
|
||||
max-height: 3lh;
|
||||
overflow-y: auto;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -976,14 +976,12 @@ const PageStore = class {
|
|||
skipMainDocument(fctxt, blocked) {
|
||||
const directives = staticNetFilteringEngine.urlSkip(fctxt, blocked);
|
||||
if ( directives === undefined ) { return; }
|
||||
if ( logger.enabled !== true ) { return; }
|
||||
fctxt.pushFilters(directives.map(a => a.logData()));
|
||||
if ( fctxt.redirectURL !== undefined ) {
|
||||
fctxt.pushFilter({
|
||||
source: 'redirect',
|
||||
raw: fctxt.redirectURL
|
||||
});
|
||||
}
|
||||
if ( fctxt.redirectURL === undefined ) { return; }
|
||||
fctxt.pushFilter({
|
||||
source: 'redirect',
|
||||
raw: fctxt.redirectURL
|
||||
});
|
||||
}
|
||||
|
||||
filterCSPReport(fctxt) {
|
||||
|
|
|
|||
|
|
@ -221,9 +221,16 @@ const onBeforeRootFrameRequest = function(fctxt) {
|
|||
|
||||
// Blocked
|
||||
|
||||
let reason = logData.reason;
|
||||
|
||||
// Find out the URL navigated to should the document not be strict-blocked
|
||||
pageStore.skipMainDocument(fctxt, false);
|
||||
|
||||
if ( reason === undefined && Array.isArray(fctxt.filter) ) {
|
||||
const filter = fctxt.filter.find(a => a.reason !== undefined);
|
||||
reason = filter?.reason;
|
||||
}
|
||||
|
||||
const query = {
|
||||
url: requestURL,
|
||||
dn: fctxt.getDomain() || requestHostname,
|
||||
|
|
@ -231,8 +238,8 @@ const onBeforeRootFrameRequest = function(fctxt) {
|
|||
hn: requestHostname,
|
||||
to: fctxt.redirectURL || '',
|
||||
};
|
||||
if ( logData.reason ) {
|
||||
query.reason = logData.reason;
|
||||
if ( reason ) {
|
||||
query.reason = reason;
|
||||
}
|
||||
|
||||
vAPI.tabs.replace(
|
||||
|
|
|
|||
Loading…
Reference in a new issue