Skip to content

Commit

Permalink
Listen for DOMContentLoaded and inject into about:blank.
Browse files Browse the repository at this point in the history
In 27e9b73 we rewrote the injection logic to depend on observer event document-element-inserted, but at about:blank that doesn't specify a document or window, which we need to inject.  Listen for DOMContentLoaded again, to inject scripts only into about:blank.

Fixes #1696
  • Loading branch information
arantius committed Feb 1, 2013
1 parent 32fc1cd commit db4e48c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions content/browser.js
Expand Up @@ -49,6 +49,16 @@ GM_BrowserUI.chromeLoad = function(e) {
sidebar.addEventListener("pagehide", GM_BrowserUI.pagehide, true);
sidebar.addEventListener("pageshow", GM_BrowserUI.pageshow, true);

document.getElementById('content').addEventListener(
'DOMContentLoaded', function(aEvent) {
var safeWin = aEvent.target.defaultView;
var href = safeWin.location.href;
if (href == 'about:blank') {
// #1696: document-element-inserted doesn't see about:blank
svc.contentLoad(aEvent)
}
}, true);

document.getElementById("contentAreaContextMenu")
.addEventListener("popupshowing", GM_BrowserUI.contextMenuShowing, false);

Expand Down

0 comments on commit db4e48c

Please sign in to comment.