OLD | NEW |
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 28 matching lines...) Expand all Loading... |
39 // In that case we get the url from top frame of the tab, recorded by | 39 // In that case we get the url from top frame of the tab, recorded by |
40 // the onBeforeRequest handler. | 40 // the onBeforeRequest handler. |
41 var frames = framesOfTabs[this._id]; | 41 var frames = framesOfTabs[this._id]; |
42 if (frames) | 42 if (frames) |
43 { | 43 { |
44 var frame = frames[0]; | 44 var frame = frames[0]; |
45 if (frame) | 45 if (frame) |
46 return frame.url; | 46 return frame.url; |
47 } | 47 } |
48 }, | 48 }, |
49 activate: function() | |
50 { | |
51 chrome.tabs.get(this._id, function(tab) | |
52 { | |
53 chrome.tabs.highlight( | |
54 { | |
55 windowId: tab.windowId, | |
56 tabs: [tab.index] | |
57 }, | |
58 function() {} | |
59 ); | |
60 }); | |
61 }, | |
62 sendMessage: function(message, responseCallback) | 49 sendMessage: function(message, responseCallback) |
63 { | 50 { |
64 chrome.tabs.sendMessage(this._id, message, responseCallback); | 51 chrome.tabs.sendMessage(this._id, message, responseCallback); |
65 } | 52 } |
66 }; | 53 }; |
67 | 54 |
68 ext._getPage = function(id) | 55 ext._getPage = function(id) |
69 { | 56 { |
70 return new Page({id: parseInt(id, 10)}); | 57 return new Page({id: parseInt(id, 10)}); |
71 }; | 58 }; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 callback(new Page(tab)); | 431 callback(new Page(tab)); |
445 } | 432 } |
446 else | 433 else |
447 { | 434 { |
448 ext.pages.open(optionsUrl, callback); | 435 ext.pages.open(optionsUrl, callback); |
449 } | 436 } |
450 }); | 437 }); |
451 }); | 438 }); |
452 }; | 439 }; |
453 })(); | 440 })(); |
OLD | NEW |