show unreachableMozSiteHint on any site in FF

fixes #1210
This commit is contained in:
tophf 2021-03-12 08:25:35 +03:00
parent 9d19d61913
commit 9531698dd7
3 changed files with 19 additions and 17 deletions

View File

@ -1590,14 +1590,6 @@
"message": "To allow access open <about:config>, right-click the list, click 'New', then 'Boolean', paste <privacy.resistFingerprinting.block_mozAddonManager> and click OK, <true>, OK, reload the <addons.mozilla.org> 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 <extensions.webextensions.restrictedDomains> in <about:config>.",
"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 <extensions.webextensions.restrictedDomains> in <about:config>.",
"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..."
},

View File

@ -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;

View File

@ -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;