aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-17 12:55:43 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-17 12:55:43 +0900
commitac8f7e65dc90327e05fb30fd5b20d56c3799f3d8 (patch)
tree05cea028a87f067a83d02638f187b92b3ec6ecd9 /src/content
parente9863299abf9498c67660e8a97c70ddb090baffe (diff)
implement go-root command
Diffstat (limited to 'src/content')
-rw-r--r--src/content/index.js2
-rw-r--r--src/content/navigates.js6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/content/index.js b/src/content/index.js
index 4751cde..a9ccd63 100644
--- a/src/content/index.js
+++ b/src/content/index.js
@@ -45,6 +45,8 @@ const execOperation = (operation) => {
return navigates.linkNext(window);
case operations.NAVIGATE_PARENT:
return navigates.parent(window);
+ case operations.NAVIGATE_ROOT:
+ return navigates.root(window);
}
};
diff --git a/src/content/navigates.js b/src/content/navigates.js
index 692b7be..64e5fc0 100644
--- a/src/content/navigates.js
+++ b/src/content/navigates.js
@@ -63,4 +63,8 @@ const parent = (win) => {
}
};
-export { historyPrev, historyNext, linkPrev, linkNext, parent };
+const root = (win) => {
+ win.location = win.location.origin;
+};
+
+export { historyPrev, historyNext, linkPrev, linkNext, parent, root };