diff options
Diffstat (limited to 'src/background/clients/FindClient.ts')
-rw-r--r-- | src/background/clients/FindClient.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/background/clients/FindClient.ts b/src/background/clients/FindClient.ts index 863c5ad..b46b964 100644 --- a/src/background/clients/FindClient.ts +++ b/src/background/clients/FindClient.ts @@ -3,6 +3,8 @@ import * as messages from "../../shared/messages"; export default interface FindClient { findNext(tabId: number, frameId: number, keyword: string): Promise<boolean>; + findPrev(tabId: number, frameId: number, keyword: string): Promise<boolean>; + clearSelection(tabId: number, frameId: number): Promise<void>; } @@ -20,6 +22,19 @@ export class FindClientImpl implements FindClient { return found; } + async findPrev( + tabId: number, + frameId: number, + keyword: string + ): Promise<boolean> { + const found = (await browser.tabs.sendMessage( + tabId, + { type: messages.FIND_PREV, keyword }, + { frameId } + )) as boolean; + return found; + } + clearSelection(tabId: number, frameId: number): Promise<void> { return browser.tabs.sendMessage( tabId, |