mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 09:06:56 +13:00
parent
3ec2c29ef0
commit
d8bbe9a501
1 changed files with 22 additions and 9 deletions
|
@ -691,6 +691,24 @@ vAPI.tabs.open = function(details) {
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
// Replace the URL of a tab. Noop if the tab does not exist.
|
||||||
|
|
||||||
|
vAPI.tabs.replace = function(tabId, url) {
|
||||||
|
var targetURL = url;
|
||||||
|
|
||||||
|
// extension pages
|
||||||
|
if ( /^[\w-]{2,}:/.test(targetURL) !== true ) {
|
||||||
|
targetURL = vAPI.getURL(targetURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
var tab = this.getTabsForIds(tabId);
|
||||||
|
if ( tab ) {
|
||||||
|
getBrowserForTab(tab).loadURI(targetURL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
vAPI.tabs._remove = function(tab, tabBrowser) {
|
vAPI.tabs._remove = function(tab, tabBrowser) {
|
||||||
if ( vAPI.fennec ) {
|
if ( vAPI.fennec ) {
|
||||||
tabBrowser.closeTab(tab);
|
tabBrowser.closeTab(tab);
|
||||||
|
@ -1119,18 +1137,13 @@ var httpObserver = {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( result.redirectUrl ) {
|
/*if ( result.redirectUrl ) {
|
||||||
if ( type === 'main_frame' ) {
|
channel.redirectionLimit = 1;
|
||||||
channel.cancel(this.ABORT);
|
|
||||||
vAPI.tabs.open({ tabId: details.tabId, url: result.redirectUrl });
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/*channel.redirectionLimit = 1;
|
|
||||||
channel.redirectTo(
|
channel.redirectTo(
|
||||||
Services.io.newURI(result.redirectUrl, null, null)
|
Services.io.newURI(result.redirectUrl, null, null)
|
||||||
);
|
);
|
||||||
return true;*/
|
return true;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue