diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-07-29 22:29:40 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 22:29:40 +0900 |
commit | 5592b02a1500062628063862158116f382f3d8e2 (patch) | |
tree | 5c29d29a8fa1aa14f4f6407a66bcaf528c42555c /src/background/infrastructures | |
parent | 75236e9a41788f64df61b14a99e78aedc548e0ad (diff) | |
parent | 1160cf8aedf9810a76d84e3d99a72365e8aeae8a (diff) |
Merge pull request #1213 from ueokande/cross-frame-search
Cross frame search
Diffstat (limited to 'src/background/infrastructures')
-rw-r--r-- | src/background/infrastructures/ContentMessageListener.ts | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/background/infrastructures/ContentMessageListener.ts b/src/background/infrastructures/ContentMessageListener.ts index 6023047..ce7ff09 100644 --- a/src/background/infrastructures/ContentMessageListener.ts +++ b/src/background/infrastructures/ContentMessageListener.ts @@ -3,13 +3,13 @@ import * as messages from "../../shared/messages"; import * as operations from "../../shared/operations"; import CommandController from "../controllers/CommandController"; import SettingController from "../controllers/SettingController"; -import FindController from "../controllers/FindController"; import AddonEnabledController from "../controllers/AddonEnabledController"; import LinkController from "../controllers/LinkController"; import OperationController from "../controllers/OperationController"; import MarkController from "../controllers/MarkController"; import CompletionController from "../controllers/CompletionController"; import ConsoleController from "../controllers/ConsoleController"; +import FindController from "../controllers/FindController"; @injectable() export default class ContentMessageListener { @@ -19,12 +19,12 @@ export default class ContentMessageListener { private readonly settingController: SettingController, private readonly commandController: CommandController, private readonly completionController: CompletionController, - private readonly findController: FindController, private readonly addonEnabledController: AddonEnabledController, private readonly linkController: LinkController, private readonly operationController: OperationController, private readonly markController: MarkController, - private readonly consoleController: ConsoleController + private readonly consoleController: ConsoleController, + private readonly findController: FindController ) {} run(): void { @@ -36,6 +36,7 @@ export default class ContentMessageListener { return {}; } return ret.catch((e) => { + console.error(e); if (!sender.tab || !sender.tab.id) { return; } @@ -45,6 +46,7 @@ export default class ContentMessageListener { }); }); } catch (e) { + console.error(e); if (!sender.tab || !sender.tab.id) { return; } @@ -80,6 +82,8 @@ export default class ContentMessageListener { return this.completionController.getProperties(); case messages.CONSOLE_ENTER_COMMAND: return this.onConsoleEnterCommand(message.text); + case messages.CONSOLE_ENTER_FIND: + return this.findController.startFind(senderTab.id!, message.keyword); case messages.CONSOLE_RESIZE: return this.onConsoleResize( senderTab.id!, @@ -88,10 +92,6 @@ export default class ContentMessageListener { ); case messages.SETTINGS_QUERY: return this.onSettingsQuery(); - case messages.FIND_GET_KEYWORD: - return this.onFindGetKeyword(); - case messages.FIND_SET_KEYWORD: - return this.onFindSetKeyword(message.keyword); case messages.ADDON_ENABLED_RESPONSE: return this.onAddonEnabledResponse(message.enabled); case messages.OPEN_URL: @@ -132,14 +132,6 @@ export default class ContentMessageListener { return (await this.settingController.getSetting()).toJSON(); } - onFindGetKeyword(): Promise<string> { - return this.findController.getKeyword(); - } - - onFindSetKeyword(keyword: string): Promise<void> { - return this.findController.setKeyword(keyword); - } - onAddonEnabledResponse(enabled: boolean): Promise<void> { return this.addonEnabledController.indicate(enabled); } |