LEFT | RIGHT |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 this._changes = null; | 398 this._changes = null; |
399 }).catch(() => | 399 }).catch(() => |
400 { | 400 { |
401 // If the tab is prerendered, browser.browserAction.set* fails | 401 // If the tab is prerendered, browser.browserAction.set* fails |
402 // and we have to delay our changes until the currently visible tab | 402 // and we have to delay our changes until the currently visible tab |
403 // is replaced with the prerendered tab. | 403 // is replaced with the prerendered tab. |
404 browser.tabs.onReplaced.addListener(onReplaced); | 404 browser.tabs.onReplaced.addListener(onReplaced); |
405 }); | 405 }); |
406 } | 406 } |
407 }, | 407 }, |
408 setIcon(path, imageData = null) | 408 setIconPath(path) |
409 { | 409 { |
410 // Use ImageData if available. | 410 this._addChange("iconPath", path); |
411 if (imageData) | 411 }, |
412 this._addChange("iconImageData", imageData); | 412 setIconImageData(imageData) |
413 else | 413 { |
414 this._addChange("iconPath", path); | 414 this._addChange("iconImageData", imageData); |
415 }, | 415 }, |
416 setBadge(badge) | 416 setBadge(badge) |
417 { | 417 { |
418 if (!badge) | 418 if (!badge) |
419 { | 419 { |
420 this._addChange("badgeText", ""); | 420 this._addChange("badgeText", ""); |
421 } | 421 } |
422 else | 422 else |
423 { | 423 { |
424 if ("number" in badge) | 424 if ("number" in badge) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 return frames.get(0) || null; | 529 return frames.get(0) || null; |
530 } | 530 } |
531 }; | 531 }; |
532 } | 532 } |
533 | 533 |
534 return ext.onMessage._dispatch( | 534 return ext.onMessage._dispatch( |
535 message, sender, sendResponse | 535 message, sender, sendResponse |
536 ).includes(true); | 536 ).includes(true); |
537 }); | 537 }); |
538 } | 538 } |
LEFT | RIGHT |