aboutsummaryrefslogtreecommitdiff
path: root/src/background/clients
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-26 16:24:14 +0900
committerGitHub <noreply@github.com>2019-05-26 16:24:14 +0900
commitcd584c8e243bafa8fc284279f716e8113607cd65 (patch)
treebc39bc30369f149e4ba4b6dc9c353b2906c4ef90 /src/background/clients
parent07897df636ca3e732490d53fd2acf947738bf16e (diff)
parent34a96cdc9c5d7c8a11c6f1ae512fbc97724f61c4 (diff)
Merge pull request #592 from ueokande/repeat-last-operation
Add "repeat last operation" command
Diffstat (limited to 'src/background/clients')
-rw-r--r--src/background/clients/NavigateClient.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/background/clients/NavigateClient.ts b/src/background/clients/NavigateClient.ts
new file mode 100644
index 0000000..bdd94ec
--- /dev/null
+++ b/src/background/clients/NavigateClient.ts
@@ -0,0 +1,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,
+ });
+ }
+}