From 4b46a2988b690379c2833eea23c30e9a8db040c1 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 23 Apr 2016 22:22:58 -0700 Subject: [PATCH] Get rid of flicker --- ext/bg/js/templates.js | 6 +----- ext/fg/js/popup.js | 9 +++++++-- ext/manifest.json | 2 +- util/tmpl/footer.html | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index d77f09f6..6c424225 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -1,11 +1,7 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; templates['footer.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper; - - return " \n \n\n"; + return " \n\n"; },"useData":true}); templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper; diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 4c5a01d8..92ade784 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -63,9 +63,14 @@ class Popup { } setContent(content) { - if (this.popup !== null) { - this.popup.setAttribute('srcdoc', content); + if (this.popup === null) { + return; } + + const doc = this.popup.contentDocument; + doc.open(); + doc.write(content); + doc.close(); } inject() { diff --git a/ext/manifest.json b/ext/manifest.json index 4e61e5c1..b454fd97 100644 --- a/ext/manifest.json +++ b/ext/manifest.json @@ -20,7 +20,7 @@ "background": {"page": "bg/background.html"}, "options_page": "bg/options.html", "permissions": ["storage"], - "web_accessible_resources": ["fg/css/popup.css", "fg/js/popup.js"], + "web_accessible_resources": ["fg/css/popup.css"], "content_scripts": [{ "matches": ["*://*/*"], diff --git a/util/tmpl/footer.html b/util/tmpl/footer.html index 7c2cac6b..2ab5c0d1 100644 --- a/util/tmpl/footer.html +++ b/util/tmpl/footer.html @@ -1,3 +1,2 @@ -