diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-23 22:22:58 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-23 22:22:58 -0700 |
commit | 4b46a2988b690379c2833eea23c30e9a8db040c1 (patch) | |
tree | b663501af68a620f65cead19a7f228815315e459 /ext | |
parent | 896cd7960cf80357cf812371fd1d918ccb30939b (diff) |
Get rid of flicker
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bg/js/templates.js | 6 | ||||
-rw-r--r-- | ext/fg/js/popup.js | 9 | ||||
-rw-r--r-- | ext/manifest.json | 2 |
3 files changed, 9 insertions, 8 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 " <script src=\"" - + container.escapeExpression(((helper = (helper = helpers.root || (depth0 != null ? depth0.root : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"root","hash":{},"data":data}) : helper))) - + "/js/popup.js\"></script>\n </body>\n</html>\n"; + return " </body>\n</html>\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": ["*://*/*"], |