Skip to content

Commit 77ed83f

Browse files
committed
Improve urlskip= filter option
Automatically upgrade `http:` to `https:` in the resulting URL. Related feedback: uBlockOrigin/uBlock-issues#3206 (comment)
1 parent 114acac commit 77ed83f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/js/static-net-filtering.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5533,7 +5533,10 @@ function urlSkip(directive, url, blocked, steps) {
55335533
return;
55345534
}
55355535
const urlfinal = new URL(urlout);
5536-
if ( urlfinal.protocol !== 'https:' ) { return; }
5536+
if ( urlfinal.protocol !== 'https:' ) {
5537+
if ( urlfinal.protocol !== 'http:' ) { return; }
5538+
urlout = urlout.replace('http', 'https');
5539+
}
55375540
if ( blocked && redirectBlocked !== true ) { return; }
55385541
return urlout;
55395542
} catch(x) {

0 commit comments

Comments
 (0)