зеркало из https://github.com/mozilla/pjs.git
Bug 423833 - "Show Only This Frame code uses about: url for error pages, instead of original site url" [p=johnath@mozilla.com (Johnathan Nightingale [johnath]) r=Mano a=blocking-firefox3+]
This commit is contained in:
Родитель
7945173f14
Коммит
e6a62ce582
|
@ -654,10 +654,10 @@ nsContextMenu.prototype = {
|
|||
// Open frame in a new tab.
|
||||
openFrameInTab: function() {
|
||||
var doc = this.target.ownerDocument;
|
||||
var frameURL = doc.documentURIObject.spec;
|
||||
var frameURL = doc.location.href;
|
||||
var referrer = doc.referrer;
|
||||
|
||||
openNewTabWith(frameURL, null, null, null, false,
|
||||
return openNewTabWith(frameURL, null, null, null, false,
|
||||
referrer ? makeURI(referrer) : null);
|
||||
},
|
||||
|
||||
|
@ -669,17 +669,17 @@ nsContextMenu.prototype = {
|
|||
// Open clicked-in frame in its own window.
|
||||
openFrame: function() {
|
||||
var doc = this.target.ownerDocument;
|
||||
var frameURL = doc.documentURIObject.spec;
|
||||
var frameURL = doc.location.href;
|
||||
var referrer = doc.referrer;
|
||||
|
||||
openNewWindowWith(frameURL, null, null, false,
|
||||
return openNewWindowWith(frameURL, null, null, false,
|
||||
referrer ? makeURI(referrer) : null);
|
||||
},
|
||||
|
||||
// Open clicked-in frame in the same window.
|
||||
showOnlyThisFrame: function() {
|
||||
var doc = this.target.ownerDocument;
|
||||
var frameURL = doc.documentURIObject.spec;
|
||||
var frameURL = doc.location.href;
|
||||
|
||||
urlSecurityCheck(frameURL, this.browser.contentPrincipal,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
|
|
|
@ -54,6 +54,7 @@ _BROWSER_FILES = browser_bug321000.js \
|
|||
browser_bug409481.js \
|
||||
browser_autodiscovery.js \
|
||||
browser_bug420160.js \
|
||||
browser_bug423833.js \
|
||||
autodiscovery.html \
|
||||
moz.png \
|
||||
browser_getshortcutoruri.js \
|
||||
|
|
|
@ -27,13 +27,13 @@ function test() {
|
|||
newBrowser.contentWindow.location = testPage;
|
||||
}
|
||||
|
||||
var loadCount = 0;
|
||||
function test1Setup() {
|
||||
if(!loadCount++)
|
||||
// Wait for both frames to load
|
||||
|
||||
if(newBrowser.contentWindow.frames.length < 2 ||
|
||||
newBrowser.contentWindow.frames[1].document.location != invalidPage)
|
||||
// The error frame hasn't loaded yet
|
||||
return;
|
||||
|
||||
loadCount = 0;
|
||||
newBrowser.removeEventListener("load", test1Setup, true);
|
||||
|
||||
var badFrame = newBrowser.contentWindow.frames[1];
|
||||
|
@ -65,11 +65,11 @@ function testShowOnlyThisFrame() {
|
|||
}
|
||||
|
||||
function test2Setup() {
|
||||
if(!loadCount++)
|
||||
// Wait for both frames to load
|
||||
if(newBrowser.contentWindow.frames.length < 2 ||
|
||||
newBrowser.contentWindow.frames[1].document.location != invalidPage)
|
||||
// The error frame hasn't loaded yet
|
||||
return;
|
||||
|
||||
loadCount = 0;
|
||||
gBrowser.removeEventListener("load", test2Setup, true);
|
||||
|
||||
// Now let's do the whole thing again, but this time for "Open frame in new tab"
|
||||
|
|
|
@ -578,7 +578,7 @@ function openNewTabWith(aURL, aDocument, aPostData, aEvent,
|
|||
// open link in new tab
|
||||
var referrerURI = aDocument ? aDocument.documentURIObject : aReferrer;
|
||||
var browser = top.document.getElementById("content");
|
||||
browser.loadOneTab(aURL, referrerURI, originCharset, aPostData,
|
||||
return browser.loadOneTab(aURL, referrerURI, originCharset, aPostData,
|
||||
loadInBackground, aAllowThirdPartyFixup || false);
|
||||
}
|
||||
|
||||
|
@ -598,7 +598,7 @@ function openNewWindowWith(aURL, aDocument, aPostData, aAllowThirdPartyFixup,
|
|||
charsetArg = "charset=" + window.content.document.characterSet;
|
||||
|
||||
var referrerURI = aDocument ? aDocument.documentURIObject : aReferrer;
|
||||
window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no",
|
||||
return window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no",
|
||||
aURL, charsetArg, referrerURI, aPostData,
|
||||
aAllowThirdPartyFixup);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче