New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
javascript.options.discardSystemSource
breaks injection in v1.5.0..v1.5.2
#570
Comments
It seems that the browser failed to get the setting from |
I have the same issue. Everything worked fine until the latest update. In Chrome "browser is not defined". |
Oh, I see. Thank you eight04. |
I had the same problem in FF 63.0.3. Solution was to set |
Hm. Not sure what's changed, but after (an unrelated) browser restart, the manager now does list styles (and The Long JSON dump{
"settings": {
"openEditInWindow": false,
"windowPosition": {},
"show-badge": true,
"disableAll": false,
"exposeIframes": false,
"newStyleAsUsercss": true,
"config.autosave": true,
"popup.breadcrumbs": true,
"popup.breadcrumbs.usePath": false,
"popup.enabledFirst": true,
"popup.stylesFirst": true,
"popup.borders": false,
"popup.findStylesInline": true,
"manage.onlyEnabled": false,
"manage.onlyLocal": false,
"manage.onlyUsercss": false,
"manage.onlyEnabled.invert": false,
"manage.onlyLocal.invert": false,
"manage.onlyUsercss.invert": false,
"manage.backup.expanded": true,
"manage.filters.expanded": true,
"manage.options.expanded": true,
"manage.newUI": true,
"manage.newUI.favicons": true,
"manage.newUI.faviconsGray": true,
"manage.newUI.targets": 3,
"manage.newUI.sort": "usercss,asc, title,asc",
"editor.options": {},
"editor.options.expanded": true,
"editor.lint.expanded": true,
"editor.lineWrapping": true,
"editor.smartIndent": false,
"editor.indentWithTabs": false,
"editor.tabSize": 4,
"editor.keyMap": "default",
"editor.theme": "default",
"editor.beautify": {
"selector_separator_newline": true,
"newline_before_open_brace": false,
"newline_after_open_brace": true,
"newline_between_properties": true,
"newline_before_close_brace": true,
"newline_between_rules": false,
"end_with_newline": false,
"indent_conditional": true,
"indent_size": 4,
"indent_char": " ",
"translate_positions": [
{
"line": 127,
"ch": 0,
"sticky": null
},
{
"line": 127,
"ch": 0,
"sticky": null
}
]
},
"editor.lintDelay": 300,
"editor.linter": "csslint",
"editor.lintReportDelay": 500,
"editor.matchHighlight": "token",
"editor.autoCloseBrackets": false,
"editor.autocompleteOnTyping": false,
"editor.contextDelete": false,
"editor.appliesToLineWidget": true,
"editor.livePreview": true,
"editor.colorpicker": true,
"editor.colorpicker.hexUppercase": false,
"editor.colorpicker.hotkey": "",
"editor.colorpicker.color": "#ff0000",
"iconset": 1,
"badgeDisabled": "#8B0000",
"badgeNormal": "#006666",
"popupWidth": 246,
"updateInterval": 24
}
} |
Which style? Which page? Is there any error in the console? It might be the CSP bug in 1.5.0. See #562 (comment). |
The one I've been using to check is one I wrote; https://gitlab.com/snippets/1698968 on https://riot.im/develop I'm not at the computer in question right now; will check logs in the morning. |
Please try v1.5.1 and report if the problem persists. |
Finally got back to this, and I've figured out the root cause - the issue manifests exactly when (EVENT_NAME => {
[native code]
})("{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}") when it should contain the following: (EVENT_NAME => {
document.currentScript.remove();
const available = checkStyleApplied();
if (available) {
window.addEventListener(EVENT_NAME, function handler(e) {
const {method, id, content} = e.detail;
if (method === 'setStyleContent') {
const el = document.getElementById(id);
if (!el) {
return;
}
const disabled = el.disabled;
el.textContent = content;
el.disabled = disabled;
} else if (method === 'orphan') {
window.removeEventListener(EVENT_NAME, handler);
}
}, true);
}
window.dispatchEvent(new CustomEvent(EVENT_NAME, {detail: {
method: 'init',
available
}}));
function checkStyleApplied() {
const style = document.createElement('style');
style.textContent = ':root{--stylus-applied:1}';
document.documentElement.appendChild(style);
const applied = getComputedStyle(document.documentElement)
.getPropertyValue('--stylus-applied');
style.remove();
return Boolean(applied);
}
})("{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}") The page's console then contains a rather opaque error:
This is true as of 1.5.2; updating title to match. |
javascript.options.discardSystemSource
breaks injection in v1.5.0..v1.5.2
I've managed to track down the failure to line 106 in prefs.js.
This promisify call results in a rejected promise, with the thoroughly unhelpful message "Error: An unexpected error occurred", no stack, and no source information.
Attempting to import my styles (exported under 1.4.23) produces results that make it clear the styles are still there; downgrading to 1.4.23 restores functionality completely.
The text was updated successfully, but these errors were encountered: