Is there any way to redirect requests without record the original URL in history? Consider that the original URL is pasted into the address bar, so it’s not about DOM manipulation.
I’ve always used redirector_ui.uc.js, but now that I’ve activated e10s, the original URL is recorded on history as well as the redirected one. The redirection still works, there is no connection to the original URL, but somehow it’s recorded in history.
I’ve tested several redirection extensions, even WebExtensions, and all of them also record the original URL.
If I disable e10s, this problem disappears. Is this a bug?
Code to reproduce using WebRequest (but this way the original URL is recorded even without e10s; for transparent redirect you run redirector_ui.uc.js):
var {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {});
function redirectAsync (requestDetails) {
if (/utm/.test(requestDetails.url)) {
console.log("Redirecting: " + requestDetails.url);
return new Promise((resolve, reject) => {
resolve({redirectUrl: 'http://www.example.com/'});
});
}
}
WebRequest.onBeforeRequest.addListener(redirectAsync, {urls: new MatchPatternSet(["http://www.example.com/*"])}, ["blocking"]);
Test link:
http://www.example.com/test?utm_source=track&utm_medium=track&utm_campaign=track