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

Unified Diff: options.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Use messaging for CSS escaping Created July 17, 2017, 11:49 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
« lib/filterComposer.js ('K') | « metadata.edge ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -71,6 +71,7 @@
const addFilter = wrapper({type: "filters.add"}, "text");
const getFilters = wrapper({type: "filters.get"}, "subscriptionUrl");
const removeFilter = wrapper({type: "filters.remove"}, "text");
+const escapeCSS = wrapper({type: "utils.escapeCSS"}, "CSS");
const whitelistedDomainRegexp = /^@@\|\|([^/:]+)\^\$document$/;
const statusMessages = new Map([
@@ -533,9 +534,14 @@
function removeFromListBox(boxId, text)
{
let list = document.getElementById(boxId);
- let selector = "option[value=" + CSS.escape(text) + "]";
- for (let option of list.querySelectorAll(selector))
- list.removeChild(option);
+ // Edge does not support CSS.escape yet:
+ // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/101410/
+ escapeCSS(text, escapedCSS =>
+ {
+ let selector = "option[value=" + escapedCSS + "]";
+ for (let option of list.querySelectorAll(selector))
+ list.removeChild(option);
+ });
}
function addWhitelistDomain(event)
« lib/filterComposer.js ('K') | « metadata.edge ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld