Explainer for stylusUnavailableForURL message

We don't mention the G+ iframe on CWS stylable only when "Out of process iframes" feature is enabled which can be set manually via chrome://flags/#enable-site-per-process. It's still in development and is known to break some sites, which is why it's not enabled by default.
This commit is contained in:
tophf 2017-04-12 16:56:41 +03:00
parent dad1d1fe5f
commit 1749057b91
26 changed files with 490 additions and 514 deletions

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "إزالة القسم",
"description": "Label for the button to remove a section"

View File

@ -294,8 +294,8 @@
"message": "Mozilla Formát",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus nefunguje na těchto stránkách.)",
"stylusUnavailableForURL": {
"message": "Stylus nefunguje na těchto stránkách.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -356,8 +356,8 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus funktioniert nicht auf Seiten wie diesen.)",
"stylusUnavailableForURL": {
"message": "Stylus funktioniert nicht auf Seiten wie diesen.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,8 +294,8 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(To Stylus δεν λειτουργεί σε σελίδες όπως αυτή.)",
"stylusUnavailableForURL": {
"message": "To Stylus δεν λειτουργεί σε σελίδες όπως αυτή.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -494,10 +494,14 @@
}
}
},
"stylishUnavailableForURL": {
"message": "(Stylus can't affect this page.)",
"stylusUnavailableForURL": {
"message": "Stylus doesn't work on pages like this.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"stylusUnavailableForURLdetails": {
"message": "As a security precaution, the browser prohibits extensions from affecting its built-in pages (like chrome://version or about:addons) as well as other extensions' pages. Chrome/Chromium forks also restrict the Chrome Web Store.",
"description": "Sub-note in the toolbar pop-up when on a URL Stylus can't affect"
},
"toggleStyle": {
"message": "Toggle style",
"description": "Label for the checkbox to enable/disable a style"
@ -515,7 +519,7 @@
"description": "Note in the toolbar popup usually on file:// URLs after [re]loading Stylus"
},
"unreachableFileHint": {
"message": "To allow Stylus access file:// URLs enable the checkbox on chrome://extensions page.",
"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"
},
"updateCheckFailBadResponseCode": {

View File

@ -350,8 +350,8 @@
"message": "Formato Mozilla",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus no funciona en páginas como esta)",
"stylusUnavailableForURL": {
"message": "Stylus no funciona en páginas como esta",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Poista osio",
"description": "Label for the button to remove a section"

View File

@ -294,8 +294,8 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus ne fonctionne pas sur les pages de ce genre)",
"stylusUnavailableForURL": {
"message": "Stylus ne fonctionne pas sur les pages de ce genre",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Rimuovi sezione",
"description": "Label for the button to remove a section"

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "セクションを削除",
"description": "Label for the button to remove a section"

View File

@ -294,8 +294,8 @@
"message": "Mozilla-opmaak",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus werkt niet op pagina's als deze.)",
"stylusUnavailableForURL": {
"message": "Stylus werkt niet op pagina's als deze.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Remover seção",
"description": "Label for the button to remove a section"

View File

@ -294,8 +294,8 @@
"message": "Формат Mozilla",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus не работает на таких страницах)",
"stylusUnavailableForURL": {
"message": "Stylus не работает на таких страницах.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,9 +294,8 @@
"message": "Mozilla формат",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus не ради на страницама као што је ова.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
"stylusUnavailableForURL": {
"message": "Stylus не ради на страницама као што је ова.", "description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Уклони одељак",

View File

@ -294,8 +294,8 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus fungerar inte på sidor som denna.)",
"stylusUnavailableForURL": {
"message": "Stylus fungerar inte på sidor som denna.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,8 +294,8 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus fungerar inte på sidor som dessa.)",
"stylusUnavailableForURL": {
"message": "Stylus fungerar inte på sidor som dessa.",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Remove section",
"description": "Label for the button to remove a section"

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "Bölümü kaldır",
"description": "Label for the button to remove a section"

View File

@ -294,10 +294,6 @@
"message": "Mozilla Format",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus does not work on pages like this.)",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {
"message": "移除节",
"description": "Label for the button to remove a section"

View File

@ -352,8 +352,8 @@
"message": "Mozilla 格式",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": "(Stylus在这样的页面上不工作)",
"stylusUnavailableForURL": {
"message": "Stylus在这样的页面上不工作",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -294,8 +294,8 @@
"message": "Mozilla格式",
"description": "Heading for the section with buttons to import/export Mozilla format of the style"
},
"stylishUnavailableForURL": {
"message": " Stylus 不能在諸如此類的網頁上生效。",
"stylusUnavailableForURL": {
"message": "Stylus 不能在諸如此類的網頁上生效。",
"description": "Note in the toolbar pop-up when on a URL Stylus can't affect"
},
"sectionRemove": {

View File

@ -14,8 +14,14 @@ const URLS = {
configureCommands:
OPERA ? 'opera://settings/configureCommands'
: 'chrome://extensions/configureCommands',
// CWS cannot be scripted in chromium, see ChromeExtensionsClient::IsScriptableURL
// https://cs.chromium.org/chromium/src/chrome/common/extensions/chrome_extensions_client.cc
chromeWebStore: FIREFOX ? 'N/A' : 'https://chrome.google.com/webstore/',
};
const RX_SUPPORTED_URLS = new RegExp(`^(file|https?|ftps?):|^${URLS.ownOrigin}`);
const RX_SUPPORTED_URLS = new RegExp(
'^(file|ftps?|http)://|' +
`^https://${FIREFOX ? '' : '(?!chrome\\.google\\.com/webstore)'}|` +
'^' + URLS.ownOrigin);
let BG = chrome.extension.getBackgroundPage();

View File

@ -66,7 +66,6 @@ a:hover {
display: table-cell;
}
#unavailable,
#installed {
border-bottom: 1px solid black;
padding-bottom: 2px;
@ -219,9 +218,7 @@ body > .actions {
}
.actions > div:not(:last-child):not(#disable-all-wrapper),
.actions > .main-controls > div:not(:last-child),
#unavailable:not(:last-child),
#unavailable + .actions {
.actions > .main-controls > div:not(:last-child) {
margin-bottom: 0.75em;
}
@ -230,24 +227,10 @@ body > .actions {
vertical-align: middle;
}
#unavailable {
border: none;
body.blocked #installed > *,
body.blocked .actions > .main-controls,
body.blocked .actions > .left-gutter {
display: none;
margin-top: 0.75em;
align-items: center;
justify-content: center;
font-size: 14px;
}
body.blocked #installed,
body.blocked #find-styles,
body.blocked #write-style,
body:not(.blocked) #unavailable {
display: none;
}
body.blocked #unavailable {
display: flex;
}
/* Never shown, but can be enabled with a style */
@ -437,22 +420,38 @@ body.blocked #unavailable {
opacity: .25;
}
.blocked:before,
.unreachable:before {
content: "__MSG_unreachableContentScript__";
padding: 5px 0.75em;
display: block;
font-weight: bold;
}
.blocked #installed:before,
.unreachable #installed:before {
content: "__MSG_unreachableFileHint__";
padding: 1px 0.75em 9px;
display: block;
font-size: 90%;
border-bottom: 1px solid black;
margin-bottom: 5px;
}
.blocked:before {
content: "__MSG_stylusUnavailableForURL__";
}
.blocked #installed:before {
content: "__MSG_stylusUnavailableForURLdetails__";
}
.unreachable:before {
content: "__MSG_unreachableContentScript__";
}
.unreachable #installed:before {
content: "__MSG_unreachableFileHint__";
border-bottom: 1px solid black;
}
@keyframes lights-off {
from {
background-color: transparent;

View File

@ -76,12 +76,6 @@
</div>
</div>
<div id="unavailable">
<div class="main-controls">
<span id="unavailable-message" i18n-text="stylishUnavailableForURL"></span>
</div>
</div>
<div id="installed"></div>
<div class="actions">

View File

@ -357,7 +357,7 @@ function handleUpdate(style) {
}
// Add an entry when a new style for the current url is installed
if (tabURL && BG.getApplicableSections({style, matchUrl: tabURL, stopOnFirst: true}).length) {
$('#unavailable').style.display = 'none';
document.body.classList.remove('blocked');
createStyleElement({style});
}
}

View File

@ -104,6 +104,12 @@ function filterStyles({
// eslint-disable-next-line no-use-before-define
const disableAll = asHash && prefs.get('disableAll', false);
if (matchUrl && matchUrl.startsWith(URLS.chromeWebStore)) {
// CWS cannot be scripted in chromium, see ChromeExtensionsClient::IsScriptableURL
// https://cs.chromium.org/chromium/src/chrome/common/extensions/chrome_extensions_client.cc
return asHash ? {} : [];
}
// add \t after url to prevent collisions (not sure it can actually happen though)
const cacheKey = ' ' + enabled + url + '\t' + id + matchUrl + '\t' + asHash + strictRegexp;
const cached = cachedStyles.filters.get(cacheKey);