mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 17:19:35 +13:00
code review re #118
This commit is contained in:
parent
390733affe
commit
df27e666a7
1 changed files with 6 additions and 13 deletions
|
@ -200,19 +200,12 @@ vAPI.tabs.open = function(details) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
chrome.tabs.query({}, function(tabs) {
|
chrome.tabs.query({ url: targetURL }, function(tabs) {
|
||||||
var rgxHash = /#.*/;
|
var tab = tabs[0];
|
||||||
// this is questionable
|
if ( tab ) {
|
||||||
var url = targetURL.replace(rgxHash, '');
|
|
||||||
var selected = tabs.some(function(tab) {
|
|
||||||
if ( tab.url.replace(rgxHash, '') === url ) {
|
|
||||||
chrome.tabs.update(tab.id, { active: true });
|
|
||||||
chrome.windows.update(tab.windowId, { focused: true });
|
chrome.windows.update(tab.windowId, { focused: true });
|
||||||
return true;
|
chrome.tabs.update(tab.id, { active: true });
|
||||||
}
|
} else {
|
||||||
});
|
|
||||||
|
|
||||||
if ( !selected ) {
|
|
||||||
wrapper();
|
wrapper();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue