Repeat open, tabopen and winopen command

This commit is contained in:
Shin'ya Ueoka 2019-05-25 21:55:45 +09:00
parent a2ee6897bf
commit 48e005dc82
7 changed files with 93 additions and 4 deletions

View file

@ -3,6 +3,10 @@ import * as messages from '../../shared/messages';
export default interface OperationClient {
execBackgroundOp(op: operations.Operation): Promise<void>;
internalOpenUrl(
url: string, newTab?: boolean, background?: boolean,
): Promise<void>;
}
export class OperationClientImpl implements OperationClient {
@ -12,4 +16,18 @@ export class OperationClientImpl implements OperationClient {
operation: op,
});
}
internalOpenUrl(
url: string, newTab?: boolean, background?: boolean,
): Promise<void> {
return browser.runtime.sendMessage({
type: messages.BACKGROUND_OPERATION,
operation: {
type: operations.INTERNAL_OPEN_URL,
url,
newTab,
background,
},
});
}
}