From ac8f7e65dc90327e05fb30fd5b20d56c3799f3d8 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Sep 2017 12:55:43 +0900 Subject: implement go-root command --- src/content/index.js | 2 ++ src/content/navigates.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/content') 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 }; -- cgit v1.2.3