aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-09 22:56:04 -0500
committerGitHub <noreply@github.com>2021-02-09 22:56:04 -0500
commit166451b8f76224542b49c13cb27a258eb291f05e (patch)
tree071438b28a04b0478586272038ea343ad4cad319 /ext/bg/js/settings
parent0f5fb804d03041b58813516721d897c4315dca8b (diff)
Improve popup window ownership (#1364)
* Update frameInformationGet to also return the tab ID * Add tabId to Frontend * Pass tabId/frameId to Display * Pass ownership information using setContent * Remove ownerFrameId for Popup classes * Use frameId instead of ownerFrameId for screenshotting * Use contentOrigin instead of owner * Update _invokeContentOrigin implementation
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r--ext/bg/js/settings/popup-preview-frame-main.js4
-rw-r--r--ext/bg/js/settings/popup-preview-frame.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/settings/popup-preview-frame-main.js b/ext/bg/js/settings/popup-preview-frame-main.js
index 71454017..dcbc0d96 100644
--- a/ext/bg/js/settings/popup-preview-frame-main.js
+++ b/ext/bg/js/settings/popup-preview-frame-main.js
@@ -26,7 +26,7 @@
try {
api.forwardLogsToBackend();
- const {frameId} = await api.frameInformationGet();
+ const {tabId, frameId} = await api.frameInformationGet();
const hotkeyHandler = new HotkeyHandler();
hotkeyHandler.prepare();
@@ -34,7 +34,7 @@
const popupFactory = new PopupFactory(frameId);
popupFactory.prepare();
- const preview = new PopupPreviewFrame(frameId, popupFactory, hotkeyHandler);
+ const preview = new PopupPreviewFrame(tabId, frameId, popupFactory, hotkeyHandler);
await preview.prepare();
document.documentElement.dataset.loaded = 'true';
diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js
index 73ac6caf..56100fb3 100644
--- a/ext/bg/js/settings/popup-preview-frame.js
+++ b/ext/bg/js/settings/popup-preview-frame.js
@@ -23,7 +23,8 @@
*/
class PopupPreviewFrame {
- constructor(frameId, popupFactory, hotkeyHandler) {
+ constructor(tabId, frameId, popupFactory, hotkeyHandler) {
+ this._tabId = tabId;
this._frameId = frameId;
this._popupFactory = popupFactory;
this._hotkeyHandler = hotkeyHandler;
@@ -67,6 +68,7 @@ class PopupPreviewFrame {
// Overwrite frontend
this._frontend = new Frontend({
+ tabId: this._tabId,
frameId: this._frameId,
popupFactory: this._popupFactory,
depth: 0,