This commit is contained in:
Tobias 2017-11-17 16:14:33 +00:00 committed by GitHub
commit acc1155cdf
2 changed files with 20 additions and 0 deletions

View file

@ -177,6 +177,20 @@ const assignManager = {
browser.webRequest.onBeforeRequest.addListener((options) => {
return this.onBeforeRequest(options);
},{urls: ["<all_urls>"], types: ["main_frame"]}, ["blocking"]);
browser.commands.onCommand.addListener(command => {
return this._onCommandHandler(command);
});
},
async _onCommandHandler(command) {
if (command === "new-tab-container") {
return browser.tabs.query({active: true, lastFocusedWindow: true}).then(tabs => {
return tabs[0];
}).then(tab => {
return browser.tabs.create({cookieStoreId: tab.cookieStoreId});
});
}
},
async _onClickedHandler(info, tab) {

View file

@ -38,6 +38,12 @@
"mac": "MacCtrl+Period"
},
"description": "Open containers panel"
},
"new-tab-container": {
"suggested_key": {
"default": "Ctrl+Y"
},
"description": "Open new tab with the same container"
}
},