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

Unified Diff: popup.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 | « include.postload.js ('k') | skin/popup.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popup.js
===================================================================
--- a/popup.js
+++ b/popup.js
@@ -33,9 +33,11 @@
{
page = pages[0];
- // Mark page as local to hide non-relevant elements
+ // Mark page as 'local' or 'nohtml' to hide non-relevant elements
if (!page || !/^https?:\/\//.test(page.url))
document.body.classList.add("local");
+ else if (!backgroundPage.htmlPages.has(page))
+ document.body.classList.add("nohtml");
// Ask content script whether clickhide is active. If so, show cancel button.
// If that isn't the case, ask background.html whether it has cached filters. If so,
« no previous file with comments | « include.postload.js ('k') | skin/popup.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld