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: Rephrase the comment Created July 27, 2017, 10:07 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 | « 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 quoteCSS = wrapper({type: "composer.quoteCSS"}, "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/
+ quoteCSS(text, escapedCSS =>
+ {
+ let selector = "option[value=" + escapedCSS + "]";
+ for (let option of list.querySelectorAll(selector))
+ list.removeChild(option);
+ });
}
function addWhitelistDomain(event)
« no previous file with comments | « metadata.edge ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld