From 3e1b4d08e6d6ecce608f0c8ee298fcae1abd2c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aykut=20=C3=87evik?= Date: Wed, 2 Oct 2019 14:55:06 +0200 Subject: [PATCH] stripping tags from URL scheme just to make sure as noted in #9, also closes #9 --- js/options.js | 1 + js/popup.js | 1 + 2 files changed, 2 insertions(+) diff --git a/js/options.js b/js/options.js index db34557..b243cb3 100644 --- a/js/options.js +++ b/js/options.js @@ -72,6 +72,7 @@ function displayWhitelistedDomains(domains) { var htmlTmpl = document.getElementById('template_list_item').innerHTML; domains.forEach(function (domain) { var punycodeDomain = punycode.toUnicode(domain); + punycodeDomain.replace(/<[^>]*>?/gm, ''); punycodeDomain = punycodeDomain.replace(/([^a-zA-Z0-9\-\.]+)/g, '$1'); var itemHtml = htmlTmpl.replace(/__DOMAIN_TEXT__/g, punycodeDomain); var itemHtml = itemHtml.replace(/__DOMAIN__/g, domain); diff --git a/js/popup.js b/js/popup.js index 4cef6bc..de60ab4 100644 --- a/js/popup.js +++ b/js/popup.js @@ -66,6 +66,7 @@ function displayBlockedDomains(urls) { var htmlTmpl = document.getElementById('template_list_item').innerHTML; urls.forEach(function (domain) { var punycodeDomain = punycode.toUnicode(domain); + punycodeDomain.replace(/<[^>]*>?/gm, ''); punycodeDomain = punycodeDomain.replace(/([^a-zA-Z0-9\-\.]+)/g, '$1'); var itemHtml = htmlTmpl.replace(/__DOMAIN_TEXT__/g, punycodeDomain); var itemHtml = itemHtml.replace(/__DOMAIN__/g, domain);