diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json index 656da989..0379fa75 100644 --- a/ext/bg/data/options-schema.json +++ b/ext/bg/data/options-schema.json @@ -109,7 +109,8 @@ "showPitchAccentDownstepNotation", "showPitchAccentPositionNotation", "showPitchAccentGraph", - "showIframePopupsInRootFrame" + "showIframePopupsInRootFrame", + "unsecurePopupFrameUrl" ], "properties": { "enable": { @@ -247,6 +248,10 @@ "showIframePopupsInRootFrame": { "type": "boolean", "default": false + }, + "unsecurePopupFrameUrl": { + "type": "boolean", + "default": false } } }, diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 35fdde82..97368a0b 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -176,7 +176,8 @@ function profileOptionsCreateDefaults() { showPitchAccentDownstepNotation: true, showPitchAccentPositionNotation: true, showPitchAccentGraph: false, - showIframePopupsInRootFrame: false + showIframePopupsInRootFrame: false, + unsecurePopupFrameUrl: false }, audio: { diff --git a/ext/bg/settings.html b/ext/bg/settings.html index a530534c..118a13b9 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -182,6 +182,10 @@ +
+ +
+
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index a8188143..af24989f 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -328,12 +328,18 @@ class Popup { async _createInjectPromise() { this._injectStyles(); + const unsecurePopupFrameUrl = (this._options !== null && this._options.general.unsecurePopupFrameUrl); const {secret, token} = await this._initializeFrame(this._frame, this._targetOrigin, this._frameId, (frame) => { frame.removeAttribute('src'); frame.removeAttribute('srcdoc'); this._observeFullscreen(true); this._onFullscreenChanged(); - frame.contentDocument.location.href = chrome.runtime.getURL('/fg/float.html'); + const url = chrome.runtime.getURL('/fg/float.html'); + if (unsecurePopupFrameUrl) { + frame.setAttribute('src', url); + } else { + frame.contentDocument.location.href = url; + } }); this._frameSecret = secret; this._frameToken = token;