I've write this script to redirect all url that not contain ¶m=param1 to url adding ¶m=param1 I have two questions.
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
return {
redirectUrl: details.url +
(details.url.indexOf("?") == -1 ? "?" : "") +
(details.url.indexOf("¶m=param1") == -1 ? "¶m=param1" : "")
};
},
{urls: ['*://*.mysite.it/*'], types: ['main_frame']},
['blocking']
);