diskort/src/script/inj.coffee

31 lines
657 B
CoffeeScript
Raw Normal View History

2022-04-12 18:36:18 +00:00
### DisKort
# (c) Er2 2022
# Zlib License
###
### Base URL
# Source code is here: https://gitdab.com/er2/diskort
# / at end is required
###
base = 'https://raw.githubusercontent.com/Er2ch/diskort/main/'
inject = ->
2022-04-24 17:14:41 +00:00
# inject webpack reader
s = document.createElement 'script'
s.setAttribute 'type', 'text/javascript'
s.setAttribute 'src', chrome.extension.getURL 'js/webpack.js'
document.head.appendChild s
# inject style
2022-04-12 18:36:18 +00:00
try
resp = await fetch base + 'btfl.css'
text = await resp.text()
s = document.createElement 'style'
s.innerHTML = text
document.head.appendChild s
catch e
console.error e
# Call it!
inject()