mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: inject stylesheet into DOM
This commit is contained in:
parent
bb069c9964
commit
2971a1d53b
2 changed files with 15 additions and 20 deletions
|
|
@ -18,3 +18,13 @@ if (document.readyState === 'loading') {
|
|||
} else {
|
||||
init()
|
||||
}
|
||||
|
||||
// injects a copy of stylesheets so that other extensions(e.g. dark reader) could read
|
||||
function injectStyles(url: string) {
|
||||
var linkElement = document.createElement('link')
|
||||
linkElement.rel = 'stylesheet'
|
||||
linkElement.setAttribute('href', url)
|
||||
document.head.appendChild(linkElement)
|
||||
}
|
||||
|
||||
injectStyles(browser.extension.getURL('content.css'))
|
||||
|
|
|
|||
|
|
@ -8,27 +8,12 @@
|
|||
"128": "icons/Gitako-128x128.png"
|
||||
},
|
||||
"homepage_url": "https://github.com/EnixCoda/Gitako",
|
||||
"permissions": [
|
||||
"storage",
|
||||
"*://*.github.com/*",
|
||||
"*://*.sentry.io/*"
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
"icons/vscode/*"
|
||||
],
|
||||
"permissions": ["storage", "*://*.github.com/*", "*://*.sentry.io/*"],
|
||||
"web_accessible_resources": ["icons/vscode/*", "content.css"],
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": [
|
||||
"https://github.com/*"
|
||||
],
|
||||
"css": [
|
||||
"content.css"
|
||||
],
|
||||
"js": [
|
||||
"firefox-shim.js",
|
||||
"browser-polyfill.js",
|
||||
"content.js"
|
||||
]
|
||||
"matches": ["https://github.com/*"],
|
||||
"js": ["firefox-shim.js", "browser-polyfill.js", "content.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue