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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 } | 311 } |
312 callback(); | 312 callback(); |
313 } | 313 } |
314 }; | 314 }; |
315 | 315 |
316 var remoteDataSource = | 316 var remoteDataSource = |
317 { | 317 { |
318 collectData: function(outerWindowID, windowURI, browser, callback) | 318 collectData: function(outerWindowID, windowURI, browser, callback) |
319 { | 319 { |
320 let dataCollector = require("dataCollector"); | 320 let {port} = require("messaging"); |
321 let screenshotWidth = screenshotDataSource.getWidth(); | 321 let screenshotWidth = screenshotDataSource.getWidth(); |
322 dataCollector.collectData(outerWindowID, screenshotWidth, data => { | 322 port.emitWithResponse("collectData", {outerWindowID, screenshotWidth}) |
| 323 .then(data => |
| 324 { |
323 screenshotDataSource.setData(data && data.screenshot); | 325 screenshotDataSource.setData(data && data.screenshot); |
324 framesDataSource.setData(windowURI, data && data.opener, data && data.refe
rrer, data && data.frames); | 326 framesDataSource.setData(windowURI, data && data.opener, data && data.refe
rrer, data && data.frames); |
325 | 327 |
326 if (data && data.isPrivate) | 328 if (data && data.isPrivate) |
327 isPrivate = true; | 329 isPrivate = true; |
328 let element = reportElement("options"); | 330 let element = reportElement("options"); |
329 appendElement(element, "option", {id: "privateBrowsing"}, isPrivate); | 331 appendElement(element, "option", {id: "privateBrowsing"}, isPrivate); |
330 | 332 |
331 callback(); | 333 callback(); |
332 }); | 334 }); |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 | 1556 |
1555 function censorURL(url) | 1557 function censorURL(url) |
1556 { | 1558 { |
1557 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1559 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
1558 } | 1560 } |
1559 | 1561 |
1560 function encodeHTML(str) | 1562 function encodeHTML(str) |
1561 { | 1563 { |
1562 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); | 1564 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); |
1563 } | 1565 } |
OLD | NEW |