Get rid of flicker

This commit is contained in:
Alex Yatskov 2016-04-23 22:22:58 -07:00
parent 896cd7960c
commit 4b46a2988b
4 changed files with 9 additions and 9 deletions

View File

@ -1,11 +1,7 @@
(function() { (function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; 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) { templates['footer.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var helper; return " </body>\n</html>\n";
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";
},"useData":true}); },"useData":true});
templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { templates['header.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var helper; var helper;

View File

@ -63,9 +63,14 @@ class Popup {
} }
setContent(content) { setContent(content) {
if (this.popup !== null) { if (this.popup === null) {
this.popup.setAttribute('srcdoc', content); return;
} }
const doc = this.popup.contentDocument;
doc.open();
doc.write(content);
doc.close();
} }
inject() { inject() {

View File

@ -20,7 +20,7 @@
"background": {"page": "bg/background.html"}, "background": {"page": "bg/background.html"},
"options_page": "bg/options.html", "options_page": "bg/options.html",
"permissions": ["storage"], "permissions": ["storage"],
"web_accessible_resources": ["fg/css/popup.css", "fg/js/popup.js"], "web_accessible_resources": ["fg/css/popup.css"],
"content_scripts": [{ "content_scripts": [{
"matches": ["*://*/*"], "matches": ["*://*/*"],

View File

@ -1,3 +1,2 @@
<script src="{{root}}/js/popup.js"></script>
</body> </body>
</html> </html>