* Fix inaccessible file message. Closes #574 * Reword inaccessible message
This commit is contained in:
parent
05ec2fb1c7
commit
764fe399f3
|
@ -1373,6 +1373,10 @@
|
|||
"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"
|
||||
},
|
||||
"InaccessibleFileHint": {
|
||||
"message": "Stylus can not access some file types (e.g. pdf & json files).",
|
||||
"description": "Note in the toolbar popup for some file types that cannot be accessed"
|
||||
},
|
||||
"updateAllCheckSucceededNoUpdate": {
|
||||
"message": "No updates found.",
|
||||
"description": "Text that displays when an update all check completed and no updates are available"
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
<template data-id="unreachableInfo">
|
||||
<div class="blocked-info">
|
||||
<label i18n-text="unreachableContentScript"></label>
|
||||
<p i18n-text="unreachableFileHint"></p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -130,6 +130,10 @@ function initPopup() {
|
|||
return;
|
||||
}
|
||||
const info = template.unreachableInfo;
|
||||
if (!FIREFOX) {
|
||||
// Chrome "Allow access to file URLs" in chrome://extensions message
|
||||
info.appendChild($create('p', t('unreachableFileHint')));
|
||||
}
|
||||
if (FIREFOX && tabURL.startsWith(URLS.browserWebStore)) {
|
||||
$('label', info).textContent = t('unreachableAMO');
|
||||
const note = (FIREFOX < 59 ? t('unreachableAMOHintOldFF') : t('unreachableAMOHint')) +
|
||||
|
@ -137,9 +141,11 @@ function initPopup() {
|
|||
const renderToken = s => s[0] === '<' ? $create('b', tWordBreak(s.slice(1, -1))) : s;
|
||||
const renderLine = line => $create('p', line.split(/(<.*?>)/).map(renderToken));
|
||||
const noteNode = $create('fragment', note.split('\n').map(renderLine));
|
||||
const target = $('p', info);
|
||||
target.parentNode.insertBefore(noteNode, target);
|
||||
target.remove();
|
||||
info.appendChild(noteNode);
|
||||
}
|
||||
// Inaccessible locally hosted file type, e.g. JSON, PDF, etc.
|
||||
if (tabURL.length - tabURL.lastIndexOf(".") <= 5) {
|
||||
info.appendChild($create('p', t('InaccessibleFileHint')));
|
||||
}
|
||||
document.body.classList.add('unreachable');
|
||||
document.body.insertBefore(info, document.body.firstChild);
|
||||
|
|
Loading…
Reference in New Issue
Block a user