Add option to use the unsecure frame URL (#618)
This commit is contained in:
parent
9e28db6ef7
commit
3db7b3a925
@ -109,7 +109,8 @@
|
|||||||
"showPitchAccentDownstepNotation",
|
"showPitchAccentDownstepNotation",
|
||||||
"showPitchAccentPositionNotation",
|
"showPitchAccentPositionNotation",
|
||||||
"showPitchAccentGraph",
|
"showPitchAccentGraph",
|
||||||
"showIframePopupsInRootFrame"
|
"showIframePopupsInRootFrame",
|
||||||
|
"unsecurePopupFrameUrl"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"enable": {
|
"enable": {
|
||||||
@ -247,6 +248,10 @@
|
|||||||
"showIframePopupsInRootFrame": {
|
"showIframePopupsInRootFrame": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"unsecurePopupFrameUrl": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -176,7 +176,8 @@ function profileOptionsCreateDefaults() {
|
|||||||
showPitchAccentDownstepNotation: true,
|
showPitchAccentDownstepNotation: true,
|
||||||
showPitchAccentPositionNotation: true,
|
showPitchAccentPositionNotation: true,
|
||||||
showPitchAccentGraph: false,
|
showPitchAccentGraph: false,
|
||||||
showIframePopupsInRootFrame: false
|
showIframePopupsInRootFrame: false,
|
||||||
|
unsecurePopupFrameUrl: false
|
||||||
},
|
},
|
||||||
|
|
||||||
audio: {
|
audio: {
|
||||||
|
@ -182,6 +182,10 @@
|
|||||||
<label><input type="checkbox" id="show-iframe-popups-in-root-frame" data-setting="general.showIframePopupsInRootFrame"> Show iframe popups in root frame</label>
|
<label><input type="checkbox" id="show-iframe-popups-in-root-frame" data-setting="general.showIframePopupsInRootFrame"> Show iframe popups in root frame</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox options-advanced">
|
||||||
|
<label><input type="checkbox" id="show-iframe-popups-in-root-frame" data-setting="general.unsecurePopupFrameUrl"> Use unsecure popup frame URL</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="checkbox options-advanced">
|
<div class="checkbox options-advanced">
|
||||||
<label><input type="checkbox" id="show-debug-info" data-setting="general.debugInfo" data-transform-pre="setDocumentAttribute" data-transform-post="setDocumentAttribute" data-document-attribute="data-options-general-debug-info"> Show debug information</label>
|
<label><input type="checkbox" id="show-debug-info" data-setting="general.debugInfo" data-transform-pre="setDocumentAttribute" data-transform-post="setDocumentAttribute" data-document-attribute="data-options-general-debug-info"> Show debug information</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -328,12 +328,18 @@ class Popup {
|
|||||||
async _createInjectPromise() {
|
async _createInjectPromise() {
|
||||||
this._injectStyles();
|
this._injectStyles();
|
||||||
|
|
||||||
|
const unsecurePopupFrameUrl = (this._options !== null && this._options.general.unsecurePopupFrameUrl);
|
||||||
const {secret, token} = await this._initializeFrame(this._frame, this._targetOrigin, this._frameId, (frame) => {
|
const {secret, token} = await this._initializeFrame(this._frame, this._targetOrigin, this._frameId, (frame) => {
|
||||||
frame.removeAttribute('src');
|
frame.removeAttribute('src');
|
||||||
frame.removeAttribute('srcdoc');
|
frame.removeAttribute('srcdoc');
|
||||||
this._observeFullscreen(true);
|
this._observeFullscreen(true);
|
||||||
this._onFullscreenChanged();
|
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._frameSecret = secret;
|
||||||
this._frameToken = token;
|
this._frameToken = token;
|
||||||
|
Loading…
Reference in New Issue
Block a user