aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-18 21:49:55 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-02 19:33:28 -0400
commit3491affcf13ef10b78714d4955da6ee9aeb11457 (patch)
treec14b6cc396b4e1f7785323101502ad67ed204ff5 /ext/fg/js/popup.js
parent53aad0bef68bf6930b684fda4a25e1a045cd800e (diff)
Update nested initialization parameters passed via message rather than using the URL query string
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js9
1 files changed, 7 insertions, 2 deletions
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