diff options
| author | Niklas Baumstark | 2012-01-21 16:27:42 +0100 |
|---|---|---|
| committer | Niklas Baumstark | 2012-04-10 23:54:36 +0200 |
| commit | 53f8158919d8b916818c54c6a9e4bf12d28df0f0 (patch) | |
| tree | b319f7681faee676178b11d321da1ed0392af4cf /background_page.html | |
| parent | f0409c59deb17443156d5f880081cd0d0bb9661d (diff) | |
| download | vimium-53f8158919d8b916818c54c6a9e4bf12d28df0f0.tar.bz2 | |
add tab completion support
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html index 97017fad..0f86e3ce 100644 --- a/background_page.html +++ b/background_page.html @@ -29,6 +29,7 @@ getBookmarks: getBookmarks, getAllBookmarks: getAllBookmarks, getHistory: getHistory, + getTabsInCurrentWindow: getTabsInCurrentWindow, }; var sendRequestHandlers = { @@ -43,7 +44,8 @@ updateScrollPosition: handleUpdateScrollPosition, copyToClipboard: copyToClipboard, isEnabledForUrl: isEnabledForUrl, - saveHelpDialogSettings: saveHelpDialogSettings + saveHelpDialogSettings: saveHelpDialogSettings, + selectSpecificTab: selectSpecificTab, }; // Event handlers @@ -259,6 +261,14 @@ Clipboard.copy(request.data); } + /** + * Selects the tab with the ID specified in request.id + */ + function selectSpecificTab(request) { + console.log("selectSpecificTab"); + chrome.tabs.update(request.id, { selected: true }); + } + /* * Used by the content scripts to get settings from the local storage. */ @@ -305,6 +315,12 @@ }); }; + function getTabsInCurrentWindow(args, port) { + chrome.tabs.getAllInWindow(null, function(tabs) { + port.postMessage({tabs:tabs}); + }); + }; + /* * Used by everyone to get settings from local storage. */ |
