aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background/actions/operation.js6
-rw-r--r--src/settings/components/form/keymaps-form.jsx1
-rw-r--r--src/shared/operations.js3
-rw-r--r--src/shared/settings/default.js1
4 files changed, 11 insertions, 0 deletions
diff --git a/src/background/actions/operation.js b/src/background/actions/operation.js
index 56eb168..10c366f 100644
--- a/src/background/actions/operation.js
+++ b/src/background/actions/operation.js
@@ -77,6 +77,12 @@ const exec = (operation, tab) => {
return browser.tabs.sendMessage(tab.id, {
type: messages.CONSOLE_HIDE,
});
+ case operations.PAGE_SOURCE:
+ return browser.tabs.create({
+ url: 'view-source:' + tab.url,
+ index: tab.index + 1,
+ openerTabId: tab.id,
+ });
default:
return Promise.resolve();
}
diff --git a/src/settings/components/form/keymaps-form.jsx b/src/settings/components/form/keymaps-form.jsx
index 0e4a223..c830d95 100644
--- a/src/settings/components/form/keymaps-form.jsx
+++ b/src/settings/components/form/keymaps-form.jsx
@@ -36,6 +36,7 @@ const KeyMapFields = [
['navigate.link.prev', 'Open previous link'],
['navigate.parent', 'Go to parent directory'],
['navigate.root', 'Go to root directory'],
+ ['page.source', 'Open page source'],
['focus.input', 'Focus input'],
], [
['find.start', 'Start find mode'],
diff --git a/src/shared/operations.js b/src/shared/operations.js
index a2f980f..e8cc8cf 100644
--- a/src/shared/operations.js
+++ b/src/shared/operations.js
@@ -37,6 +37,9 @@ export default {
// Focus
FOCUS_INPUT: 'focus.input',
+ // Page
+ PAGE_SOURCE: 'page.source',
+
// Tabs
TAB_CLOSE: 'tabs.close',
TAB_CLOSE_FORCE: 'tabs.close.force',
diff --git a/src/shared/settings/default.js b/src/shared/settings/default.js
index 3b6706d..9e1c202 100644
--- a/src/shared/settings/default.js
+++ b/src/shared/settings/default.js
@@ -48,6 +48,7 @@ export default {
"gu": { "type": "navigate.parent" },
"gU": { "type": "navigate.root" },
"gi": { "type": "focus.input" },
+ "gf": { "type": "page.source" },
"y": { "type": "urls.yank" },
"p": { "type": "urls.paste", "newTab": false },
"P": { "type": "urls.paste", "newTab": true },