aboutsummaryrefslogtreecommitdiff
path: root/src/content/client/TabsClient.ts
blob: 9169a3df567db6f063397ed4d2831605cd466cbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as messages from "../../shared/messages";

export default interface TabsClient {
  openUrl(url: string, newTab: boolean, background?: boolean): Promise<void>;
}

export class TabsClientImpl implements TabsClient {
  async openUrl(
    url: string,
    newTab: boolean,
    background?: boolean
  ): Promise<void> {
    await browser.runtime.sendMessage({
      type: messages.OPEN_URL,
      url,
      newTab,
      background,
    });
  }
}