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

Unified Diff: lib/ui.js

Issue 4559243822759936: Issue 431/432 - Remove special handling for the $sitekey option (Closed)
Patch Set: Created Aug. 11, 2014, 5:13 p.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 | « lib/matcher.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -1088,8 +1088,8 @@
let state = (Prefs.enabled ? "active" : "disabled");
if (state == "active")
{
- let location = this.getCurrentLocation(window);
- if (location && Policy.isWhitelisted(location.spec))
+ let {getBrowser} = require("appSupport");
+ if (Policy.isWindowWhitelisted(getBrowser(window).contentWindow))
state = "whitelisted";
}
@@ -1330,10 +1330,9 @@
*/
removeWhitelist: function(/**Window*/ window)
{
- let location = this.getCurrentLocation(window);
let filter = null;
- if (location)
- filter = Policy.isWhitelisted(location.spec);
+ let {getBrowser} = require("appSupport");
+ filter = Policy.isWindowWhitelisted(getBrowser(window).contentWindow);
if (filter && filter.subscriptions.length && !filter.disabled)
{
UI.toggleFilter(filter);
@@ -1682,8 +1681,8 @@
}
// Add "Remove exception" menu item if necessary
- let location = this.getCurrentLocation(window);
- let filter = (location ? Policy.isWhitelisted(location.spec) : null);
+ let {getBrowser} = require("appSupport");
+ let filter = Policy.isWindowWhitelisted(getBrowser(window).contentWindow);
if (filter && filter.subscriptions.length && !filter.disabled)
{
let label = this.overlay.attributes.whitelistcontextlabel;
« no previous file with comments | « lib/matcher.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld