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.
This commit is contained in:
ispedals 2016-06-18 18:35:41 -04:00
parent 28de6a4d6e
commit 651231fbc1

View File

@ -62,10 +62,8 @@ class Popup {
return; return;
} }
const doc = this.popup.contentDocument; const doc = this.popup;
doc.open(); doc.srcdoc=content;
doc.write(content);
doc.close();
} }
sendMessage(action, params, callback) { sendMessage(action, params, callback) {