pageLoad hooks now fire on sidebar.

This commit is contained in:
satyr 2010-04-11 04:15:53 +09:00
Родитель 27e0be4204
Коммит 71c559619a
1 изменённых файлов: 9 добавлений и 12 удалений

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

@ -306,20 +306,17 @@ var UbiquitySetup = {
setupWindow: function setupWindow(window) {
gServices.feedManager.installToWindow(window);
const PAGE_LOAD_PREF = "extensions.ubiquity.enablePageLoadHandlers";
function onPageLoad(aEvent) {
var isEnabled = gPrefs.getValue(PAGE_LOAD_PREF, true);
if (!isEnabled)
return;
if (aEvent.originalTarget.location)
gServices.commandSource.onPageLoad(aEvent.originalTarget);
function onPageLoad(event) {
if (gPrefs.get("extensions.ubiquity.enablePageLoadHandlers", true) &&
event.originalTarget.location)
gServices.commandSource.onPageLoad(event.originalTarget);
}
var appcontent = window.document.getElementById("appcontent");
if (appcontent)
appcontent.addEventListener("DOMContentLoaded", onPageLoad, true);
for each (let id in ["appcontent", "sidebar"]) {
let browser = window.document.getElementById(id);
if (browser)
browser.addEventListener("DOMContentLoaded", onPageLoad, true);
}
},
get languageCode getLanguageCode()