Bug 569342: Find bar should not be enabled in about:addons. r=gavin, a=blocks-final

This commit is contained in:
Dave Townsend 2011-01-11 13:33:51 -08:00
Родитель d9ba510227
Коммит 900e16f795
5 изменённых файлов: 60 добавлений и 5 удалений

Просмотреть файл

@ -146,6 +146,7 @@ _BROWSER_FILES = \
browser_bug562649.js \
browser_bug563588.js \
browser_bug565575.js \
browser_zbug569342.js \
browser_bug575561.js \
browser_bug577121.js \
browser_bug579872.js \

Просмотреть файл

@ -0,0 +1,48 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
var gTab = null;
function cleanUp() {
gBrowser.removeTab(gTab);
finish();
}
// function borrowed from browser_bug386835.js
function load(tab, url, cb) {
tab.linkedBrowser.addEventListener("load", function (event) {
event.currentTarget.removeEventListener("load", arguments.callee, true);
cb();
}, true);
tab.linkedBrowser.loadURI(url);
}
function test() {
waitForExplicitFinish();
gTab = gBrowser.selectedTab = gBrowser.addTab();
ok(gFindBar.hidden, "Find bar should not be visible");
run_test_1();
}
function run_test_1() {
load(gTab, "about:config", function() {
ok(gFindBar.hidden, "Find bar should not be visible");
EventUtils.synthesizeKey("/", {}, gTab.linkedBrowser.contentWindow);
ok(gFindBar.hidden, "Find bar should not be visible");
run_test_2();
});
}
function run_test_2() {
load(gTab, "about:addons", function() {
ok(gFindBar.hidden, "Find bar should not be visible");
EventUtils.synthesizeKey("/", {}, gTab.linkedBrowser.contentWindow);
ok(gFindBar.hidden, "Find bar should not be visible");
cleanUp();
});
}

Просмотреть файл

@ -49,6 +49,7 @@
role="application"
width="750"
height="500"
disablefastfind="true"
onunload="onConfigUnload();"
onload="onConfigLoad();">

Просмотреть файл

@ -1360,10 +1360,15 @@
if (win && !this._mimeTypeIsTextBased(win.document.contentType))
return false;
// disable FAYT in about:config and about:blank to prevent FAYT
// opening unexpectedly - to fix bugs 264562, 267150, 269712
var url = this.browser.currentURI.spec;
if (url == "about:blank" || url == "about:config")
// disable FAYT in about:blank to prevent FAYT opening unexpectedly.
var url = this.browser.currentURI;
if (url.spec == "about:blank")
return false;
// disable FAYT in documents that ask for it to be disabled.
if ((url.schemeIs("about") || url.schemeIs("chrome")) &&
(win.document.documentElement &&
win.document.documentElement.getAttribute("disablefastfind") == "true"))
return false;
if (win) {

Просмотреть файл

@ -51,7 +51,7 @@
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
id="addons-page" title="&addons.windowTitle;" disablechrome="true"
role="application" windowtype="Addons:Manager"
role="application" windowtype="Addons:Manager" disablefastfind="true"
ondragenter="gDragDrop.onDragOver(event)"
ondragover="gDragDrop.onDragOver(event)"
ondrop="gDragDrop.onDrop(event)">