summaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-05 22:03:35 -0400
committerGitHub <noreply@github.com>2020-09-05 22:03:35 -0400
commit44f38c4dea6d517bb7657063ed2394745945c1f8 (patch)
tree9a1e9f4eb781a8b551730284a6360cdcb6bf9c0a /ext/fg/js/frontend.js
parent55770934f807d94d35a99e739b2ee326bfd4afbd (diff)
Popup window (#773)
* Add option usePopupWindow * Add PopupWindow class * Add support for creating PopupWindow
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 8c4cfc82..b9656882 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -307,11 +307,17 @@ class Frontend {
}
async _updatePopup() {
- const showIframePopupsInRootFrame = this._options.general.showIframePopupsInRootFrame;
+ const {usePopupWindow, showIframePopupsInRootFrame} = this._options.general;
const isIframe = !this._useProxyPopup && (window !== window.parent);
let popupPromise;
- if (
+ if (usePopupWindow) {
+ popupPromise = this._popupCache.get('window');
+ if (typeof popupPromise === 'undefined') {
+ popupPromise = this._getPopupWindow();
+ this._popupCache.set('window', popupPromise);
+ }
+ } else if (
isIframe &&
showIframePopupsInRootFrame &&
DocumentUtil.getFullscreenElement() === null &&
@@ -404,6 +410,14 @@ class Frontend {
return popup;
}
+ async _getPopupWindow() {
+ return await this._popupFactory.getOrCreatePopup({
+ ownerFrameId: this._frameId,
+ depth: this._depth,
+ popupWindow: true
+ });
+ }
+
_ignoreElements() {
if (this._popup !== null) {
const container = this._popup.container;