| Left: | ||
| Right: |
| 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-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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 // but sometimes we only have the tab id when we create a Page object. | 88 // but sometimes we only have the tab id when we create a Page object. |
| 89 // In that case we get the url from top frame of the tab, recorded by | 89 // In that case we get the url from top frame of the tab, recorded by |
| 90 // the onBeforeRequest handler. | 90 // the onBeforeRequest handler. |
| 91 let frames = framesOfTabs.get(this.id); | 91 let frames = framesOfTabs.get(this.id); |
| 92 if (frames) | 92 if (frames) |
| 93 { | 93 { |
| 94 let frame = frames.get(0); | 94 let frame = frames.get(0); |
| 95 if (frame) | 95 if (frame) |
| 96 return frame.url; | 96 return frame.url; |
| 97 } | 97 } |
| 98 | |
| 99 return undefined; | |
|
kzar
2018/08/08 11:15:19
This looks like an unrelated change? If not could
hub
2018/08/14 11:37:03
Without it eslint show an error
81:12 error E
| |
| 98 }, | 100 }, |
| 99 sendMessage(message, responseCallback) | 101 sendMessage(message, responseCallback) |
| 100 { | 102 { |
| 101 browser.tabs.sendMessage(this.id, message, responseCallback); | 103 browser.tabs.sendMessage(this.id, message, responseCallback); |
| 102 } | 104 } |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 ext.getPage = id => new Page({id: parseInt(id, 10)}); | 107 ext.getPage = id => new Page({id: parseInt(id, 10)}); |
| 106 | 108 |
| 107 ext.pages = { | 109 ext.pages = { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 return frames.get(0) || null; | 568 return frames.get(0) || null; |
| 567 } | 569 } |
| 568 }; | 570 }; |
| 569 } | 571 } |
| 570 | 572 |
| 571 return ext.onMessage._dispatch( | 573 return ext.onMessage._dispatch( |
| 572 message, sender, sendResponse | 574 message, sender, sendResponse |
| 573 ).includes(true); | 575 ).includes(true); |
| 574 }); | 576 }); |
| 575 } | 577 } |
| OLD | NEW |