summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Buckley-Houston <tom@tombh.co.uk>2019-06-19 13:21:41 +0300
committerThomas Buckley-Houston <tom@tombh.co.uk>2019-06-19 13:21:41 +0300
commit95562aa12938b6d845f578dd4bb4eb7046012216 (patch)
treee6596e5c1b0ef37d577e136bfddbc0649ee2e2e1
parentd6b5951059c886a1e3d3f276faa48d8a97a77ab7 (diff)
HTTP server: fixes that were causing page hangs
-rw-r--r--webext/src/background/tab.js8
-rw-r--r--webext/src/dom/manager.js2
2 files changed, 8 insertions, 2 deletions
diff --git a/webext/src/background/tab.js b/webext/src/background/tab.js
index d67a0eb..7f0dc78 100644
--- a/webext/src/background/tab.js
+++ b/webext/src/background/tab.js
@@ -116,7 +116,13 @@ export default class extends utils.mixins(CommonMixin, TabCommandsMixin) {
sendGlobalConfig(config) {
config.http_server_mode_type = this._calculateMode();
config.start_time = this.start_time;
- this.channel.postMessage(`/config,${JSON.stringify(config)}`);
+ if (this.channel) {
+ this.channel.postMessage(`/config,${JSON.stringify(config)}`);
+ } else {
+ setTimeout(() => {
+ this.sendGlobalConfig(config);
+ }, 1);
+ }
}
_listenForMessages() {
diff --git a/webext/src/dom/manager.js b/webext/src/dom/manager.js
index 82c0676..76d5afe 100644
--- a/webext/src/dom/manager.js
+++ b/webext/src/dom/manager.js
@@ -25,6 +25,7 @@ export default class extends utils.mixins(CommonMixin, CommandsMixin) {
}
_postSetupConstructor() {
+ this._injectCustomCSS();
this.dimensions.channel = this.channel;
this.graphics_builder = new GraphicsBuilder(
this.channel,
@@ -191,7 +192,6 @@ 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", () => {