Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/ext/background.js

Issue 5455624317960192: Issue 2079 - Use chrome.tabs.update instead chrome.tabs.highlight for compatibility with Opera (Closed)
Patch Set: Created March 2, 2015, 7:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 if (!win.incognito) 512 if (!win.incognito)
513 queryInfo.windowId = win.id; 513 queryInfo.windowId = win.id;
514 514
515 chrome.tabs.query(queryInfo, function(tabs) 515 chrome.tabs.query(queryInfo, function(tabs)
516 { 516 {
517 if (tabs.length > 0) 517 if (tabs.length > 0)
518 { 518 {
519 var tab = tabs[0]; 519 var tab = tabs[0];
520 520
521 chrome.windows.update(tab.windowId, {focused: true}); 521 chrome.windows.update(tab.windowId, {focused: true});
522 chrome.tabs.highlight( 522 chrome.tabs.update(tab.id, {active: true});
523 {
524 windowId: tab.windowId,
525 tabs: [tab.index]
526 },
527 function() {}
528 );
529 523
530 if (callback) 524 if (callback)
531 callback(new Page(tab)); 525 callback(new Page(tab));
532 } 526 }
533 else 527 else
534 { 528 {
535 ext.pages.open(optionsUrl, callback); 529 ext.pages.open(optionsUrl, callback);
536 } 530 }
537 }); 531 });
538 }); 532 });
539 }; 533 };
540 })(); 534 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld