summaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/content-script-main.js3
-rw-r--r--ext/fg/js/float-main.js4
-rw-r--r--ext/fg/js/frontend.js12
-rw-r--r--ext/fg/js/popup-factory.js7
-rw-r--r--ext/fg/js/popup-proxy.js2
-rw-r--r--ext/fg/js/popup-window.js4
-rw-r--r--ext/fg/js/popup.js3
7 files changed, 14 insertions, 21 deletions
diff --git a/ext/fg/js/content-script-main.js b/ext/fg/js/content-script-main.js
index 42f95e24..5dee4c56 100644
--- a/ext/fg/js/content-script-main.js
+++ b/ext/fg/js/content-script-main.js
@@ -27,7 +27,7 @@
api.forwardLogsToBackend();
await yomichan.backendReady();
- const {frameId} = await api.frameInformationGet();
+ const {tabId, frameId} = await api.frameInformationGet();
if (typeof frameId !== 'number') {
throw new Error('Failed to get frameId');
}
@@ -39,6 +39,7 @@
popupFactory.prepare();
const frontend = new Frontend({
+ tabId,
frameId,
popupFactory,
depth: 0,
diff --git a/ext/fg/js/float-main.js b/ext/fg/js/float-main.js
index 2b81a08a..efc012d7 100644
--- a/ext/fg/js/float-main.js
+++ b/ext/fg/js/float-main.js
@@ -32,12 +32,14 @@
api.forwardLogsToBackend();
await yomichan.backendReady();
+ const {tabId, frameId} = await api.frameInformationGet();
+
const japaneseUtil = new JapaneseUtil(null);
const hotkeyHandler = new HotkeyHandler();
hotkeyHandler.prepare();
- const display = new Display('popup', japaneseUtil, documentFocusController, hotkeyHandler);
+ const display = new Display(tabId, frameId, 'popup', japaneseUtil, documentFocusController, hotkeyHandler);
await display.prepare();
const displayProfileSelection = new DisplayProfileSelection(display);
displayProfileSelection.prepare();
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index f02d5609..a62b06bf 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -28,6 +28,7 @@ class Frontend {
pageType,
popupFactory,
depth,
+ tabId,
frameId,
parentPopupId,
parentFrameId,
@@ -40,6 +41,7 @@ class Frontend {
this._pageType = pageType;
this._popupFactory = popupFactory;
this._depth = depth;
+ this._tabId = tabId;
this._frameId = frameId;
this._parentPopupId = parentPopupId;
this._parentFrameId = parentFrameId;
@@ -437,7 +439,6 @@ class Frontend {
return await this._popupFactory.getOrCreatePopup({
frameId: this._frameId,
- ownerFrameId: this._frameId,
depth: this._depth,
childrenSupported: this._childrenSupported
});
@@ -446,7 +447,6 @@ class Frontend {
async _getProxyPopup() {
return await this._popupFactory.getOrCreatePopup({
frameId: this._parentFrameId,
- ownerFrameId: this._frameId,
depth: this._depth,
parentPopupId: this._parentPopupId,
childrenSupported: this._childrenSupported
@@ -469,7 +469,6 @@ class Frontend {
const popup = await this._popupFactory.getOrCreatePopup({
frameId: targetFrameId,
- ownerFrameId: this._frameId,
id: popupId,
childrenSupported: this._childrenSupported
});
@@ -482,7 +481,6 @@ class Frontend {
async _getPopupWindow() {
return await this._popupFactory.getOrCreatePopup({
- ownerFrameId: this._frameId,
depth: this._depth,
popupWindow: true,
childrenSupported: this._childrenSupported
@@ -537,7 +535,11 @@ class Frontend {
documentTitle
},
content: {
- definitions
+ definitions,
+ contentOrigin: {
+ tabId: this._tabId,
+ frameId: this._frameId
+ }
}
};
if (textSource instanceof TextSourceElement && textSource.fullContent !== query) {
diff --git a/ext/fg/js/popup-factory.js b/ext/fg/js/popup-factory.js
index 6960b254..7571d7ab 100644
--- a/ext/fg/js/popup-factory.js
+++ b/ext/fg/js/popup-factory.js
@@ -56,7 +56,6 @@ class PopupFactory {
async getOrCreatePopup({
frameId=null,
- ownerFrameId=null,
id=null,
parentPopupId=null,
depth=null,
@@ -103,8 +102,7 @@ class PopupFactory {
const popup = new PopupWindow({
id,
depth,
- frameId: this._frameId,
- ownerFrameId
+ frameId: this._frameId
});
this._popups.set(id, popup);
return popup;
@@ -117,7 +115,6 @@ class PopupFactory {
id,
depth,
frameId: this._frameId,
- ownerFrameId,
childrenSupported
});
if (parent !== null) {
@@ -139,14 +136,12 @@ class PopupFactory {
id,
parentPopupId,
frameId,
- ownerFrameId,
childrenSupported
}));
const popup = new PopupProxy({
id,
depth,
frameId,
- ownerFrameId,
frameOffsetForwarder: useFrameOffsetForwarder ? this._frameOffsetForwarder : null
});
this._popups.set(id, popup);
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index bb037705..b2e81824 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -24,14 +24,12 @@ class PopupProxy extends EventDispatcher {
id,
depth,
frameId,
- ownerFrameId,
frameOffsetForwarder
}) {
super();
this._id = id;
this._depth = depth;
this._frameId = frameId;
- this._ownerFrameId = ownerFrameId;
this._frameOffsetForwarder = frameOffsetForwarder;
this._frameOffset = [0, 0];
diff --git a/ext/fg/js/popup-window.js b/ext/fg/js/popup-window.js
index a6011874..9398c287 100644
--- a/ext/fg/js/popup-window.js
+++ b/ext/fg/js/popup-window.js
@@ -23,14 +23,12 @@ class PopupWindow extends EventDispatcher {
constructor({
id,
depth,
- frameId,
- ownerFrameId
+ frameId
}) {
super();
this._id = id;
this._depth = depth;
this._frameId = frameId;
- this._ownerFrameId = ownerFrameId;
this._popupTabId = null;
}
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 5c2e57e9..47330090 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -27,14 +27,12 @@ class Popup extends EventDispatcher {
id,
depth,
frameId,
- ownerFrameId,
childrenSupported
}) {
super();
this._id = id;
this._depth = depth;
this._frameId = frameId;
- this._ownerFrameId = ownerFrameId;
this._childrenSupported = childrenSupported;
this._parent = null;
this._child = null;
@@ -275,7 +273,6 @@ class Popup extends EventDispatcher {
depth: this._depth,
parentPopupId: this._id,
parentFrameId: this._frameId,
- ownerFrameId: this._ownerFrameId,
childrenSupported: this._childrenSupported,
scale: this._contentScale,
optionsContext: this._optionsContext