More CssStyleApplier updates (#1785)

* Update eslint rules for css-style-applier.js

* Don't use chrome.runtime.getURL

* Update CSP to allow inline styles
This commit is contained in:
toasted-nutbread 2021-07-02 22:12:02 -04:00 committed by GitHub
parent 56b2462f13
commit a4715935cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View File

@ -112,6 +112,7 @@
"ext/js/core.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js"
],
@ -125,6 +126,7 @@
"ext/js/core.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js"
],
@ -155,6 +157,7 @@
"ext/js/yomichan.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js"
],

View File

@ -73,7 +73,7 @@
"pages": [
"template-renderer.html"
],
"content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'"
"content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'unsafe-inline'"
},
"permissions": [
"<all_urls>",

View File

@ -83,7 +83,7 @@ class CssStyleApplier {
// Private
async _fetchJsonAsset(url) {
const response = await fetch(chrome.runtime.getURL(url), {
const response = await fetch(url, {
method: 'GET',
mode: 'no-cors',
cache: 'default',

View File

@ -72,7 +72,7 @@
"pages": [
"template-renderer.html"
],
"content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'"
"content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'unsafe-inline'"
},
"permissions": [
"<all_urls>",