mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-27 21:01:00 +03:00
Fixed Chrome Invidious CSS issues.
Apparently the chrome API doesn't work well with CSS. Resolves https://github.com/ajayyy/SponsorBlock/issues/241
This commit is contained in:
29
src/utils.ts
29
src/utils.ts
@@ -6,6 +6,17 @@ class Utils {
|
||||
// Contains functions needed from the background script
|
||||
backgroundScriptContainer: any = null;
|
||||
|
||||
// Used to add content scripts and CSS required
|
||||
js = [
|
||||
"./js/vendor.js",
|
||||
"./js/content.js"
|
||||
];
|
||||
css = [
|
||||
"content.css",
|
||||
"./libs/Source+Sans+Pro.css",
|
||||
"popup.css"
|
||||
];
|
||||
|
||||
constructor(backgroundScriptContainer?: any) {
|
||||
this.backgroundScriptContainer = backgroundScriptContainer;
|
||||
}
|
||||
@@ -67,25 +78,15 @@ class Utils {
|
||||
* For now, it is just SB.config.invidiousInstances.
|
||||
*/
|
||||
setupExtraSiteContentScripts() {
|
||||
let js = [
|
||||
"./js/vendor.js",
|
||||
"./js/content.js"
|
||||
];
|
||||
let css = [
|
||||
"content.css",
|
||||
"./libs/Source+Sans+Pro.css",
|
||||
"popup.css"
|
||||
];
|
||||
|
||||
let self = this;
|
||||
|
||||
if (this.isFirefox()) {
|
||||
let firefoxJS = [];
|
||||
for (const file of js) {
|
||||
for (const file of this.js) {
|
||||
firefoxJS.push({file});
|
||||
}
|
||||
let firefoxCSS = [];
|
||||
for (const file of css) {
|
||||
for (const file of this.css) {
|
||||
firefoxCSS.push({file});
|
||||
}
|
||||
|
||||
@@ -119,8 +120,8 @@ class Utils {
|
||||
// This API is experimental and not visible by the TypeScript compiler
|
||||
actions: [new (<any> chrome.declarativeContent).RequestContentScript({
|
||||
allFrames: true,
|
||||
js,
|
||||
css
|
||||
js: self.js,
|
||||
css: self.css
|
||||
})]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user