| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 23 matching lines...) Expand all Loading... | |
| 34 extractHostFromFrame(sender.frame), | 34 extractHostFromFrame(sender.frame), |
| 35 checkWhitelisted(sender.page, sender.frame, | 35 checkWhitelisted(sender.page, sender.frame, |
| 36 RegExpFilter.typeMap.GENERICHIDE) | 36 RegExpFilter.typeMap.GENERICHIDE) |
| 37 ); | 37 ); |
| 38 else | 38 else |
| 39 selectors = []; | 39 selectors = []; |
| 40 | 40 |
| 41 return {selectors: selectors, trace: trace}; | 41 return {selectors: selectors, trace: trace}; |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 port.on("websocket-request", function(msg, sender) | |
|
Sebastian Noack
2016/06/28 16:17:51
Please no new code in background.js. This file is
kzar
2016/06/29 13:40:30
Done.
| |
| 45 { | |
| 46 var results = ext.webRequest.onBeforeRequest._dispatch( | |
| 47 new URL(msg.url), | |
|
Sebastian Noack
2016/06/28 16:17:51
Is it possible to create a WebSocket with a relati
kzar
2016/06/29 13:40:30
No, I don't believe it's possible. (I see an excep
lainverse
2016/06/29 13:54:58
As I understood you must pass FQDN URL. At least f
Sebastian Noack
2016/07/01 17:03:39
Ah right. Of course it needs to be an absolute URL
| |
| 48 "OTHER", | |
| 49 sender.page, | |
| 50 sender.frame | |
| 51 ); | |
| 52 return results.indexOf(false) != -1; | |
| 53 }); | |
| 54 | |
| 44 port.on("forward", function(msg, sender) | 55 port.on("forward", function(msg, sender) |
| 45 { | 56 { |
| 46 var targetPage; | 57 var targetPage; |
| 47 if (msg.targetPageId) | 58 if (msg.targetPageId) |
| 48 targetPage = ext.getPage(msg.targetPageId); | 59 targetPage = ext.getPage(msg.targetPageId); |
| 49 else | 60 else |
| 50 targetPage = sender.page; | 61 targetPage = sender.page; |
| 51 | 62 |
| 52 if (targetPage) | 63 if (targetPage) |
| 53 { | 64 { |
| 54 msg.payload.sender = sender.page.id; | 65 msg.payload.sender = sender.page.id; |
| 55 if (msg.expectsResponse) | 66 if (msg.expectsResponse) |
| 56 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); | 67 return new Promise(targetPage.sendMessage.bind(targetPage, msg.payload)); |
| 57 targetPage.sendMessage(msg.payload); | 68 targetPage.sendMessage(msg.payload); |
| 58 } | 69 } |
| 59 }); | 70 }); |
| OLD | NEW |