From 48e005dc825a5211b4d3e92ed06ad15e01c23d13 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 25 May 2019 21:55:45 +0900 Subject: Repeat open, tabopen and winopen command --- src/content/client/OperationClient.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/content/client') diff --git a/src/content/client/OperationClient.ts b/src/content/client/OperationClient.ts index d699fec..5dbe555 100644 --- a/src/content/client/OperationClient.ts +++ b/src/content/client/OperationClient.ts @@ -3,6 +3,10 @@ import * as messages from '../../shared/messages'; export default interface OperationClient { execBackgroundOp(op: operations.Operation): Promise; + + internalOpenUrl( + url: string, newTab?: boolean, background?: boolean, + ): Promise; } export class OperationClientImpl implements OperationClient { @@ -12,4 +16,18 @@ export class OperationClientImpl implements OperationClient { operation: op, }); } + + internalOpenUrl( + url: string, newTab?: boolean, background?: boolean, + ): Promise { + return browser.runtime.sendMessage({ + type: messages.BACKGROUND_OPERATION, + operation: { + type: operations.INTERNAL_OPEN_URL, + url, + newTab, + background, + }, + }); + } } -- cgit v1.2.3