diff options
author | gorhill <rhill@raymondhill.net> | 2015-05-24 18:50:09 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-05-24 18:50:09 -0400 |
commit | 72c930ddffc18de4d5cd6c59d945ba04ad0b323f (patch) | |
tree | 89c3a9e33380758e4d15399246ab3ef1c1f9996b /platform/chromium | |
parent | c265d6747b5ad13e80f8ebb9ccfdbaa5f5c2f6d5 (diff) | |
download | uBlock-72c930ddffc18de4d5cd6c59d945ba04ad0b323f.zip uBlock-72c930ddffc18de4d5cd6c59d945ba04ad0b323f.tar.gz uBlock-72c930ddffc18de4d5cd6c59d945ba04ad0b323f.tar.bz2 |
logger: UI work on URL-based dynamic filtering
Diffstat (limited to 'platform/chromium')
-rw-r--r-- | platform/chromium/vapi-background.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 9c9f231..9381cb8 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -392,6 +392,27 @@ vAPI.tabs.reload = function(tabId /*, flags*/) { /******************************************************************************/ +// Select a specific tab. + +vAPI.tabs.select = function(tabId) { + tabId = toChromiumTabId(tabId); + if ( tabId === 0 ) { + return; + } + + chrome.tabs.update(tabId, { active: true }, function(tab) { + if ( chrome.runtime.lastError ) { + /* noop */ + } + if ( !tab ) { + return; + } + chrome.windows.update(tab.windowId, { focused: true }); + }); +}; + +/******************************************************************************/ + vAPI.tabs.injectScript = function(tabId, details, callback) { var onScriptExecuted = function() { // https://code.google.com/p/chromium/issues/detail?id=410868#c8 |