Merge pull request #368 from emlow/issue-279

Add shortcut to view page source
This commit is contained in:
Shin'ya Ueoka 2018-05-05 18:39:56 +09:00 committed by GitHub
commit 828ac8cd84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 0 deletions

View file

@ -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();
}