summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/backend.js2
-rw-r--r--ext/bg/js/search.js2
-rw-r--r--ext/fg/js/frontend-initialize.js2
-rw-r--r--ext/fg/js/popup-proxy-host.js11
4 files changed, 12 insertions, 5 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index adc6f13d..349fb4eb 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -694,7 +694,7 @@ class Backend {
await Backend._focusTab(tab);
if (queryParams.query) {
await new Promise((resolve) => chrome.tabs.sendMessage(
- tab.id, {action: 'searchQueryUpdate', params: {query: queryParams.query}}, resolve
+ tab.id, {action: 'searchQueryUpdate', params: {text: queryParams.query}}, resolve
));
}
return true;
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index f9481ea2..5881f6f8 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -56,7 +56,7 @@ class DisplaySearch extends Display {
]);
this._runtimeMessageHandlers = new Map([
- ['searchQueryUpdate', ({query}) => { this.onExternalSearchUpdate(query); }]
+ ['searchQueryUpdate', this.onExternalSearchUpdate.bind(this)]
]);
}
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js
index bbb789cc..e674724e 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/frontend-initialize.js
@@ -31,7 +31,7 @@ async function main() {
const popupHost = new PopupProxyHost();
await popupHost.prepare();
- popup = popupHost.getOrCreatePopup();
+ popup = popupHost.getOrCreatePopup(null, null, depth);
}
const frontend = new Frontend(popup, ignoreNodes);
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index 7d86aa67..49123ee1 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -47,7 +47,7 @@ class PopupProxyHost {
]));
}
- getOrCreatePopup(id=null, parentId=null) {
+ getOrCreatePopup(id=null, parentId=null, depth=null) {
// Find by existing id
if (id !== null) {
const popup = this._popups.get(id);
@@ -76,7 +76,14 @@ class PopupProxyHost {
}
// Create new popup
- const depth = (parent !== null ? parent.depth + 1 : 0);
+ if (parent !== null) {
+ if (depth !== null) {
+ throw new Error('Depth cannot be set when parent exists');
+ }
+ depth = parent.depth + 1;
+ } else if (depth === null) {
+ depth = 0;
+ }
const popup = new Popup(id, depth, this._frameIdPromise);
if (parent !== null) {
popup.setParent(parent);