Skip to content

Commit

Permalink
Improve urlskip= filter option
Browse files Browse the repository at this point in the history
Automatically upgrade `http:` to `https:` in the resulting URL.

Related feedback:
uBlockOrigin/uBlock-issues#3206 (comment)
  • Loading branch information
gorhill committed Nov 18, 2024
1 parent 114acac commit 77ed83f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 77ed83f

Please sign in to comment.