Repeat open, tabopen and winopen command
This commit is contained in:
parent
a2ee6897bf
commit
48e005dc82
7 changed files with 93 additions and 4 deletions
|
@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue