mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 1b23439451a8 (bug 1079245)
This commit is contained in:
parent
03ddfdcbae
commit
3f586a3e72
@ -936,7 +936,6 @@ var gBrowserInit = {
|
|||||||
LanguageDetectionListener.init();
|
LanguageDetectionListener.init();
|
||||||
BrowserOnClick.init();
|
BrowserOnClick.init();
|
||||||
DevEdition.init();
|
DevEdition.init();
|
||||||
AboutPrivateBrowsingListener.init();
|
|
||||||
|
|
||||||
let mm = window.getGroupMessageManager("browsers");
|
let mm = window.getGroupMessageManager("browsers");
|
||||||
mm.loadFrameScript("chrome://browser/content/content.js", true);
|
mm.loadFrameScript("chrome://browser/content/content.js", true);
|
||||||
@ -7776,13 +7775,3 @@ let PanicButtonNotifier = {
|
|||||||
popup.hidePopup();
|
popup.hidePopup();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let AboutPrivateBrowsingListener = {
|
|
||||||
init: function () {
|
|
||||||
window.messageManager.addMessageListener(
|
|
||||||
"AboutPrivateBrowsing:OpenPrivateWindow",
|
|
||||||
msg => {
|
|
||||||
OpenBrowserWindow({private: true});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
@ -479,29 +479,6 @@ let AboutHomeListener = {
|
|||||||
};
|
};
|
||||||
AboutHomeListener.init(this);
|
AboutHomeListener.init(this);
|
||||||
|
|
||||||
let AboutPrivateBrowsingListener = {
|
|
||||||
init: function(chromeGlobal) {
|
|
||||||
chromeGlobal.addEventListener('AboutPrivateBrowsingOpenWindow', this,
|
|
||||||
false, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
get isAboutPrivateBrowsing() {
|
|
||||||
return content.document.documentURI.toLowerCase() == "about:privatebrowsing";
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEvent: function(aEvent) {
|
|
||||||
if (!this.isAboutPrivateBrowsing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (aEvent.type) {
|
|
||||||
case "AboutPrivateBrowsingOpenWindow":
|
|
||||||
sendAsyncMessage("AboutPrivateBrowsing:OpenPrivateWindow");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
AboutPrivateBrowsingListener.init(this);
|
|
||||||
|
|
||||||
let AboutReaderListener = {
|
let AboutReaderListener = {
|
||||||
|
|
||||||
_articlePromise: null,
|
_articlePromise: null,
|
||||||
|
@ -7,17 +7,24 @@
|
|||||||
* opened one time when in private browsing.
|
* opened one time when in private browsing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
add_task(function* test() {
|
function test() {
|
||||||
let win = yield BrowserTestUtils.openNewBrowserWindow({private: true});
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var win = OpenBrowserWindow({private: true});
|
||||||
|
|
||||||
let tab = win.gBrowser.selectedTab = win.gBrowser.addTab("about:addons");
|
whenDelayedStartupFinished(win, function() {
|
||||||
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
win.gBrowser.loadURI("about:addons");
|
||||||
yield promiseWaitForFocus(win);
|
|
||||||
|
|
||||||
EventUtils.synthesizeKey("a", { ctrlKey: true, shiftKey: true }, win);
|
waitForFocus(function() {
|
||||||
|
EventUtils.synthesizeKey("a", { ctrlKey: true, shiftKey: true }, win);
|
||||||
|
|
||||||
|
is(win.gBrowser.tabs.length, 1, "about:addons tab was re-focused.");
|
||||||
|
is(win.gBrowser.currentURI.spec, "about:addons", "Addons tab was opened.");
|
||||||
|
|
||||||
|
win.close();
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
is(win.gBrowser.tabs.length, 2, "about:addons tab was re-focused.");
|
|
||||||
is(win.gBrowser.currentURI.spec, "about:addons", "Addons tab was opened.");
|
|
||||||
|
|
||||||
yield BrowserTestUtils.closeWindow(win);
|
|
||||||
});
|
|
||||||
|
@ -61,7 +61,6 @@ static RedirEntry kRedirMap[] = {
|
|||||||
nsIAboutModule::ALLOW_SCRIPT |
|
nsIAboutModule::ALLOW_SCRIPT |
|
||||||
nsIAboutModule::HIDE_FROM_ABOUTABOUT },
|
nsIAboutModule::HIDE_FROM_ABOUTABOUT },
|
||||||
{ "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
|
{ "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
|
||||||
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
|
||||||
nsIAboutModule::ALLOW_SCRIPT },
|
nsIAboutModule::ALLOW_SCRIPT },
|
||||||
{ "rights",
|
{ "rights",
|
||||||
#ifdef MOZ_OFFICIAL_BRANDING
|
#ifdef MOZ_OFFICIAL_BRANDING
|
||||||
|
@ -17,6 +17,13 @@ if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
|
|||||||
setFavIcon("chrome://browser/skin/Privacy-16.png");
|
setFavIcon("chrome://browser/skin/Privacy-16.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
.getInterface(Ci.nsIWebNavigation)
|
||||||
|
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||||
|
.rootTreeItem
|
||||||
|
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
.getInterface(Ci.nsIDOMWindow);
|
||||||
|
|
||||||
function setFavIcon(url) {
|
function setFavIcon(url) {
|
||||||
var icon = document.createElement("link");
|
var icon = document.createElement("link");
|
||||||
icon.setAttribute("rel", "icon");
|
icon.setAttribute("rel", "icon");
|
||||||
@ -47,7 +54,5 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
function openPrivateWindow() {
|
function openPrivateWindow() {
|
||||||
// Ask chrome to open a private window
|
mainWindow.OpenBrowserWindow({private: true});
|
||||||
document.dispatchEvent(
|
|
||||||
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true}));
|
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,8 @@ function test() {
|
|||||||
|
|
||||||
function testDownloadDir(aWin, gDownloadLastDir, aFile, aDisplayDir, aLastDir,
|
function testDownloadDir(aWin, gDownloadLastDir, aFile, aDisplayDir, aLastDir,
|
||||||
aGlobalLastDir, aCallback) {
|
aGlobalLastDir, aCallback) {
|
||||||
|
let context = aWin.gBrowser.selectedBrowser.contentWindow;
|
||||||
|
|
||||||
// Check lastDir preference.
|
// Check lastDir preference.
|
||||||
is(prefs.getComplexValue("lastDir", Ci.nsIFile).path, aDisplayDir.path,
|
is(prefs.getComplexValue("lastDir", Ci.nsIFile).path, aDisplayDir.path,
|
||||||
"LastDir should be the expected display dir");
|
"LastDir should be the expected display dir");
|
||||||
@ -76,7 +78,7 @@ function test() {
|
|||||||
aCallback();
|
aCallback();
|
||||||
};
|
};
|
||||||
|
|
||||||
launcherDialog.promptForSaveToFileAsync(launcher, aWin, null, null, null);
|
launcherDialog.promptForSaveToFileAsync(launcher, context, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
testOnWindow(false, function(win, downloadDir) {
|
testOnWindow(false, function(win, downloadDir) {
|
||||||
|
Loading…
Reference in New Issue
Block a user