aboutsummaryrefslogtreecommitdiff
path: root/src/background/clients/NavigateClient.ts
blob: 40ceb457e67ec060f351e144f26294ed4f73bbf2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { injectable } from "tsyringe";
import * as messages from "../../shared/messages";

@injectable()
export default class NavigateClient {
  async historyNext(tabId: number): Promise<void> {
    await browser.tabs.sendMessage(tabId, {
      type: messages.NAVIGATE_HISTORY_NEXT,
    });
  }

  async historyPrev(tabId: number): Promise<void> {
    await browser.tabs.sendMessage(tabId, {
      type: messages.NAVIGATE_HISTORY_PREV,
    });
  }

  async linkNext(tabId: number): Promise<void> {
    await browser.tabs.sendMessage(tabId, {
      type: messages.NAVIGATE_LINK_NEXT,
    });
  }

  async linkPrev(tabId: number): Promise<void> {
    await browser.tabs.sendMessage(tabId, {
      type: messages.NAVIGATE_LINK_PREV,
    });
  }
}