From 61dd7225c7b6a2bb9346c76926b5e96264f831b8 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Wed, 8 Apr 2020 21:52:58 -0400 Subject: Update HTTPS Everywhere to 2020.3.16. --- .../pages/cancel/index.html | 26 ++++--- .../pages/cancel/style.css | 87 ++++++++++++++-------- .../https-everywhere@eff.org/pages/cancel/ux.js | 33 +++++++- 3 files changed, 102 insertions(+), 44 deletions(-) (limited to 'data/extensions/https-everywhere@eff.org/pages/cancel') diff --git a/data/extensions/https-everywhere@eff.org/pages/cancel/index.html b/data/extensions/https-everywhere@eff.org/pages/cancel/index.html index 5dd3551..3522301 100644 --- a/data/extensions/https-everywhere@eff.org/pages/cancel/index.html +++ b/data/extensions/https-everywhere@eff.org/pages/cancel/index.html @@ -1,24 +1,28 @@ - - + + - - + + ⚠ HTTPS Everywhere ⚠ - - + +
-

HTTPS Everywhere

+

+ HTTPS Everywhere +

+

- URL: PLACEHOLDER + URL:

-
- -
+
+ + +
diff --git a/data/extensions/https-everywhere@eff.org/pages/cancel/style.css b/data/extensions/https-everywhere@eff.org/pages/cancel/style.css index 1858867..9b91ca3 100644 --- a/data/extensions/https-everywhere@eff.org/pages/cancel/style.css +++ b/data/extensions/https-everywhere@eff.org/pages/cancel/style.css @@ -1,48 +1,77 @@ -body{ +body { margin-top: 6em; - position: relative; - text-align: center; + font-size: 12pt; + font-family: sans-serif; + line-height: 150%; } -.content{ - width: 600px; +.content { margin: auto; - text-align: left; + max-width: 600px; } -h1{ - text-align: center; +h1 { + display: block; } -form, button, p{ - font-size: 12pt; - font-family: sans-serif; - line-height: 150%; +h1 img { + width: 100%; + height: auto; } -form{ - overflow: auto; - margin-bottom: 1em; +#url-paragraph { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } -form button{ - padding: .5em 1em; - background-color: #aaa; - color: #fff; - border: none; +button { + background-color: #ec1e1e; + border: 1px solid #ec1e1e; border-radius: 4px; + color: #fff; cursor: pointer; + padding: 0.5em 1em; + display: block; + float: none; + font-size: 12pt; + margin: 8px 0; + line-height: 150%; } -#url-value{ - display: block; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; +button:hover { + background-color: #fff; + color: #ec1e1e; } -#open-url-button{ - display: inline-block; - float: left; - background-color: #ec1e1e; +button:last-child { + margin: 0; +} + +@media screen and (max-width: 550px) { + button { + width: 100%; + margin: 8px 0; + } +} + +@media (prefers-color-scheme: dark) { + body { + background-color: #202023; + color: #f9f9fa; + } + + a { + color: #45a1ff; + } + + button { + color: #202023; + } + + button:hover { + background-color: #202023; + border-color: #ec1e1e; + } } diff --git a/data/extensions/https-everywhere@eff.org/pages/cancel/ux.js b/data/extensions/https-everywhere@eff.org/pages/cancel/ux.js index a1773ca..7e6199a 100644 --- a/data/extensions/https-everywhere@eff.org/pages/cancel/ux.js +++ b/data/extensions/https-everywhere@eff.org/pages/cancel/ux.js @@ -20,23 +20,38 @@ function replaceLink(explainer) { observer.disconnect(); const linkText = chrome.i18n.getMessage("cancel_he_blocking_network"); const link = document.createElement("a"); + link.classList.add("wikilink"); link.href = "https://en.wikipedia.org/wiki/Downgrade_attack"; link.innerText = linkText; explainer.innerHTML = explainer.innerHTML.replace(linkText, link.outerHTML); + + /* + In response to translation of i18n string "cancel_he_blocking_network". + Within context of the paragraph and as a standalone string can be interpreted differently + langauge to language. + + So if link fails to swap in replace, this conditional is triggered + */ + if (document.getElementsByClassName("wikilink").length === 0) { + link.innerText = linkText; + explainer.after(link); + } + } function displayURL() { - const cancelURL = new URL(window.location.href); - const originURL = decodeURI(cancelURL.searchParams.get('originURL')); + const searchParams = new URLSearchParams(window.location.search); + const originURL = searchParams.get('originURL'); const originURLLink = document.getElementById('url-value'); const openURLButton = document.getElementById('open-url-button'); + const openHttpOnce = document.getElementById('http-once-button'); + const url = new URL(originURL); - originURLLink.innerHTML = originURL; + originURLLink.innerText = originURL; originURLLink.href = originURL; openURLButton.addEventListener("click", function() { if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) { - const url = new URL(originURL); sendMessage("disable_on_site", url.host, () => { window.location = originURL; }); @@ -44,4 +59,14 @@ function displayURL() { return false; }); + + openHttpOnce.addEventListener("click", function() { + if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) { + sendMessage("disable_on_site_once", url.host, () => { + window.location = originURL; + }); + } + + return false; + }); } -- cgit v1.2.3