From 9531698dd7118132d1c944cafca5e23bf6974c97 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 12 Mar 2021 08:25:35 +0300 Subject: [PATCH] show unreachableMozSiteHint on any site in FF fixes #1210 --- _locales/en/messages.json | 16 ++++++++-------- popup/popup.css | 9 +++++---- popup/popup.js | 11 ++++++----- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 79aeef9e..f7cb74fa 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1590,14 +1590,6 @@ "message": "To allow access open , right-click the list, click 'New', then 'Boolean', paste and click OK, , OK, reload the page.", "description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59" }, - "unreachableAMOHintNewFF": { - "message": "In Firefox 60 and newer you'll also have to remove AMO domain from in .", - "description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59" - }, - "unreachableAMOHintOldFF": { - "message": "Only Firefox 59 and newer can be configured to allow WebExtensions to add style elements on CSP-protected sites such as this one.", - "description": "Note in the popup when opened on addons.mozilla.org in Firefox < 59" - }, "unreachableContentScript": { "message": "Could not communicate with the page. Try reloading the tab.", "description": "Note in the toolbar popup usually on file:// URLs after [re]loading Stylus" @@ -1606,6 +1598,14 @@ "message": "Stylus can access file:// URLs only if you enable the corresponding checkbox for Stylus extension on chrome://extensions page.", "description": "Note in the toolbar popup for file:// URLs" }, + "unreachableMozSiteHint": { + "message": "In Firefox 60 and newer you need to remove this domain from in .", + "description": "Note in the popup when opened on a restricted mozilla site in Firefox >= 60" + }, + "unreachableMozSiteHintOldFF": { + "message": "Only Firefox 59 and newer can be configured to allow WebExtensions to add style elements on CSP-protected sites such as this one.", + "description": "Note in the popup when opened on a restricted mozilla site in Firefox < 59" + }, "unzipStyles": { "message": "Unzipping styles..." }, diff --git a/popup/popup.css b/popup/popup.css index 756f896f..7de1e71e 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -781,6 +781,7 @@ body.blocked .actions > .main-controls { .blocked-info { hyphens: none; word-wrap: break-word; + overflow-wrap: anywhere; line-height: 16px; position: relative; } @@ -801,8 +802,8 @@ body.blocked .actions > .main-controls { .blocked-info .copy { cursor: pointer; transition: all .1s; - border-bottom: 1px dotted #000; - text-decoration: none; + text-decoration: underline; + text-decoration-style: dotted; font-weight: bold; } @@ -820,8 +821,8 @@ body.blocked .actions > .main-controls { position: absolute; display: none; top: 0; - left: calc(var(--outer-padding) * -1); - right: calc(var(--outer-padding) * -1); + left: 0; + right: 0; font-weight: bold; font-size: 13px; text-align: center; diff --git a/popup/popup.js b/popup/popup.js index 9309fa88..cef66666 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -173,15 +173,16 @@ function initUnreachable(isStore) { if (!FIREFOX) { // Chrome "Allow access to file URLs" in chrome://extensions message info.appendChild($create('p', t('unreachableFileHint'))); - } else if (isStore) { + } else { $('label', info).textContent = t('unreachableAMO'); - const note = (FIREFOX < 59 ? t('unreachableAMOHintOldFF') : t('unreachableAMOHint')) + - (FIREFOX < 60 ? '' : '\n' + t('unreachableAMOHintNewFF')); + const note = [ + isStore && t(FIREFOX >= 59 ? 'unreachableAMOHint' : 'unreachableMozSiteHintOldFF'), + FIREFOX >= 60 && t('unreachableMozSiteHint'), + ].filter(Boolean).join('\n'); const renderToken = s => s[0] === '<' - ? $create('button.fake', { + ? $create('button.fake.copy', { textContent: s.slice(1, -1), onclick: Events.copyContent, - className: 'copy', title: t('copy'), }) : s;