[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 13/483: Add missing checks
David Prévot
taffit at moszumanska.debian.org
Thu Jan 22 21:41:22 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.
commit 5651617fc8c10d23ec1269963670a399d50ce660
Author: Wladimir Palant <trev at gtchat.de>
Date: Mon Jan 8 22:07:01 2007 +0000
Add missing checks
--HG--
extra : convert_revision : svn%3Ad8bf93c1-8190-44a8-bb31-1ea94378a4df/trunk%40610
---
chrome/content/aardvark.js | 3 +++
chrome/content/overlay.js | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/chrome/content/aardvark.js b/chrome/content/aardvark.js
index cc212d9..065057d 100644
--- a/chrome/content/aardvark.js
+++ b/chrome/content/aardvark.js
@@ -36,6 +36,9 @@ var ehhAardvark = {
};
ehhAardvark.start = function(wnd) {
+ if (!wnd || !(wnd.document instanceof HTMLDocument) || !wnd.document.body || wnd.location.href == "about:blank")
+ return;
+
wnd.addEventListener("click", this.mouseClick, false);
wnd.addEventListener("mouseover", this.mouseOver, false);
wnd.addEventListener("keypress", this.keyPress, false);
diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js
index 4a066e2..dd27e86 100644
--- a/chrome/content/overlay.js
+++ b/chrome/content/overlay.js
@@ -83,7 +83,10 @@ function ehhFillPopup(event) {
popup = popup.replace(/popup$/, '');
- var enabled = (window.content && content.document instanceof HTMLDocument && content.location.href != "about:blank");
+ var enabled = (window.content &&
+ content.document instanceof HTMLDocument &&
+ content.document.body &&
+ content.location.href != "about:blank");
var running = (enabled && window.content == ehhAardvark.wnd);
document.getElementById(popup + "ehh-selectelement").setAttribute("disabled", !enabled);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git
More information about the Pkg-mozext-commits
mailing list