diff options
author | Thomas Buckley-Houston <tom@tombh.co.uk> | 2019-06-18 12:54:29 +0300 |
---|---|---|
committer | Thomas Buckley-Houston <tom@tombh.co.uk> | 2019-06-18 12:54:29 +0300 |
commit | 31def7cc30ff4d14896fc8ea95615b4f64ffb5b1 (patch) | |
tree | 62e9d1bf0aa2f786e1ffebe82fb9638e93af9f9e | |
parent | c7ddd91d25e9c9e0e468020061eebc713f0d3630 (diff) |
Config to set custom global CSS
-rw-r--r-- | interfacer/src/browsh/config_sample.go | 8 | ||||
-rw-r--r-- | webext/src/dom/manager.js | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/interfacer/src/browsh/config_sample.go b/interfacer/src/browsh/config_sample.go index 7c60553..f1cc07b 100644 --- a/interfacer/src/browsh/config_sample.go +++ b/interfacer/src/browsh/config_sample.go @@ -22,6 +22,14 @@ websocket-port = 3334 # then this experimental feature should help. It can also be toggled in-browser with F6. use_experimental_text_visibility = false +# Custom CSS to apply to all loaded tabs, eg; +# custom_css = """ +# body { +# background-colour: black; +# } +# """ +custom_css = "" + [firefox] # The path to your Firefox binary path = "firefox" diff --git a/webext/src/dom/manager.js b/webext/src/dom/manager.js index 33ee112..82c0676 100644 --- a/webext/src/dom/manager.js +++ b/webext/src/dom/manager.js @@ -191,6 +191,7 @@ export default class extends utils.mixins(CommonMixin, CommandsMixin) { this.is_dom_loaded = true; this.log("DOM LOADED"); this._fixStickyElements(); + this._injectCustomCSS(); this._willHideText(); }); window.addEventListener("load", () => { @@ -251,4 +252,10 @@ export default class extends utils.mixins(CommonMixin, CommandsMixin) { } } } + + _injectCustomCSS() { + var node = document.createElement("style"); + node.innerHTML = this.config.browsh.custom_css; + document.body.appendChild(node); + } } |