Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.postload.js

Issue 4840054052618240: Issue 1428 - Disable "Block Element" on non-HTML pages (Closed)
Patch Set: Removed outdated comment Created Sept. 26, 2014, 10:21 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | popup.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -479,11 +479,7 @@
return components[1] + newPath;
}
-// Content scripts are apparently invoked on non-HTML documents, so we have to
-// check for that before doing stuff. |document instanceof HTMLDocument| check
-// will fail on some sites like planet.mozilla.org because WebKit creates
-// Document instances for XHTML documents, have to test the root element.
-if (document.documentElement instanceof HTMLElement)
+if (document instanceof HTMLDocument)
{
// Use a contextmenu handler to save the last element the user right-clicked on.
// To make things easier, we actually save the DOM event.
@@ -645,4 +641,7 @@
break;
}
});
+
+ if (window == window.top)
+ ext.backgroundPage.sendMessage({type: "report-html-page"});
}
« no previous file with comments | « background.js ('k') | popup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld