From 3491affcf13ef10b78714d4955da6ee9aeb11457 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Aug 2019 21:49:55 -0400 Subject: Update nested initialization parameters passed via message rather than using the URL query string --- ext/fg/js/popup.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ext/fg/js/popup.js') diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 24b5684d..ab1dbbed 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -29,6 +29,7 @@ class Popup { this.container.id = 'yomichan-float'; this.container.addEventListener('mousedown', e => e.stopPropagation()); this.container.addEventListener('scroll', e => e.stopPropagation()); + this.container.setAttribute('src', chrome.extension.getURL('/fg/float.html')); this.container.style.width = '0px'; this.container.style.height = '0px'; this.injectPromise = null; @@ -53,9 +54,13 @@ class Popup { } return new Promise((resolve) => { - const parent = (typeof this.frameId === 'number' ? this.frameId : ''); - this.container.setAttribute('src', chrome.extension.getURL(`/fg/float.html?id=${this.id}&depth=${this.depth}&parent=${parent}`)); + const parentFrameId = (typeof this.frameId === 'number' ? this.frameId : null); this.container.addEventListener('load', () => { + this.invokeApi('popupNestedInitialize', { + id: this.id, + depth: this.depth, + parentFrameId + }); this.invokeApi('setOptions', { general: { customPopupCss: options.general.customPopupCss -- cgit v1.2.3