Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement global hotkey for tab selector #547

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@ var ChromeService = (function() {
chrome.tabs.remove(tabs[0].id);
});
break;
case 'chooseTab':
chrome.tabs.query({
currentWindow: true,
active: true
}, function(resp) {
var cur = resp[0].id;
chrome.tabs.sendMessage(cur, {
target: 'content_runtime',
subject: 'chooseTab'
});
});
break;
case 'proxyThis':
chrome.tabs.query({
currentWindow: true,
Expand Down
4 changes: 4 additions & 0 deletions content_scripts/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ var Front = (function() {
});
};

runtime.runtime_handlers['chooseTab'] = function(msg, sender, response) {
self.chooseTab();
};

runtime.runtime_handlers['focusFrame'] = function(msg, sender, response) {
if (msg.frameId === window.frameId) {
window.focus();
Expand Down
3 changes: 3 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"closeTab": {
"description": "Close the current tab."
},
"chooseTab": {
"description": "Invoke tab selector."
},
"proxyThis": {
"description": "Toggle current site in autoproxy_hosts."
}
Expand Down