From a2a4531527c7786af18611e1d423c1504bb9245e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 28 Mar 2021 11:06:19 +0900 Subject: Send resize message to the sender tab instead of the current tab. Sending resize message to the current table occurs an error, just after switching the tab by a `tabopen` command. The background script unable to connect the current (new tab) because it is in an initialization. --- src/background/infrastructures/ContentMessageListener.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/background/infrastructures/ContentMessageListener.ts') diff --git a/src/background/infrastructures/ContentMessageListener.ts b/src/background/infrastructures/ContentMessageListener.ts index ec87938..6023047 100644 --- a/src/background/infrastructures/ContentMessageListener.ts +++ b/src/background/infrastructures/ContentMessageListener.ts @@ -81,7 +81,11 @@ export default class ContentMessageListener { case messages.CONSOLE_ENTER_COMMAND: return this.onConsoleEnterCommand(message.text); case messages.CONSOLE_RESIZE: - return this.onConsoleResize(message.width, message.height); + return this.onConsoleResize( + senderTab.id!, + message.width, + message.height + ); case messages.SETTINGS_QUERY: return this.onSettingsQuery(); case messages.FIND_GET_KEYWORD: @@ -116,8 +120,12 @@ export default class ContentMessageListener { return this.commandController.exec(text); } - onConsoleResize(width: number, height: number): Promise { - return this.consoleController.resize(width, height); + onConsoleResize( + senderTabId: number, + width: number, + height: number + ): Promise { + return this.consoleController.resize(senderTabId, width, height); } async onSettingsQuery(): Promise { -- cgit v1.2.3