1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-24 11:22:44 +01:00

Improve urlskip= filter option

Automatically upgrade `http:` to `https:` in the resulting URL.

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2480930555
This commit is contained in:
Raymond Hill 2024-11-18 14:19:21 -05:00
parent 114acacd2e
commit 77ed83ff2f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -5533,7 +5533,10 @@ function urlSkip(directive, url, blocked, steps) {
return;
}
const urlfinal = new URL(urlout);
if ( urlfinal.protocol !== 'https:' ) { return; }
if ( urlfinal.protocol !== 'https:' ) {
if ( urlfinal.protocol !== 'http:' ) { return; }
urlout = urlout.replace('http', 'https');
}
if ( blocked && redirectBlocked !== true ) { return; }
return urlout;
} catch(x) {