summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorispedals <ispedals@users.noreply.github.com>2016-06-18 18:35:41 -0400
committerispedals <ispedals@users.noreply.github.com>2016-06-19 12:54:30 -0400
commit651231fbc136ad2574c18d837151aa4dd6c2306e (patch)
treee99d3d7e75b699fac4a464e2e1a549a63dc234cd /ext
parent28de6a4d6ecac9dade41f511c426fc16a443c537 (diff)
Use iFrame srcdoc attribute to set the content of the popup
Previously the contentdocument of the iFrame was opened and document.write() was being used set the contents of the popup. In Gecko, content scripts do not have the same security context as of the embedded page, so the call to document.open() results in a SecurityError.
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/popup.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 78106319..4c2b18f7 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -62,10 +62,8 @@ class Popup {
return;
}
- const doc = this.popup.contentDocument;
- doc.open();
- doc.write(content);
- doc.close();
+ const doc = this.popup;
+ doc.srcdoc=content;
}
sendMessage(action, params, callback) {