I am trying to redirect url when a specific tab is created in a background script. In Firefox it works, in Chrome & Opera it works in normal window but in private window I have the following message : “Requests to the server were blocked by an addon. Try to deactivate addons.”.
I tried with browser.tabs.update and browser.webRequest.onBeforeRequest as below but none works :
browser.webNavigation.onCreatedNavigationTarget.addListener(function(info){
if(info.tabId==MYTAB) browser.tabs.update(info.tabId,{url: MYURL});
});
browser.webRequest.onBeforeRequest.addListener(
function(info){
if(info.tabId==MYTAB) return {redirectUrl: MYURL};
},
{urls: ["<all_urls>"], types: ["main_frame"]},
["blocking"]
);
Google Chrome :
Opera :
Does someone have any idea?
I still have no solution…