Browse Source

this fixes #1013, #1062 (draft)

pull/2/head
gorhill 10 years ago
parent
commit
d8bbe9a501
  1. 31
      platform/firefox/vapi-background.js

31
platform/firefox/vapi-background.js

@ -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 ( type === 'main_frame' ) {
channel.cancel(this.ABORT);
vAPI.tabs.open({ tabId: details.tabId, url: result.redirectUrl });
return true;
}
/*channel.redirectionLimit = 1;
/*if ( result.redirectUrl ) {
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…
Cancel
Save