OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 610 } |
611 }; | 611 }; |
612 | 612 |
613 let errorsDataSource = | 613 let errorsDataSource = |
614 { | 614 { |
615 collectData: function(wnd, windowURI, callback) | 615 collectData: function(wnd, windowURI, callback) |
616 { | 616 { |
617 let {addonID} = require("info"); | 617 let {addonID} = require("info"); |
618 addonID = addonID.replace(/[\{\}]/g, ""); | 618 addonID = addonID.replace(/[\{\}]/g, ""); |
619 | 619 |
620 let messages = {}; | 620 // See https://bugzilla.mozilla.org/show_bug.cgi?id=664695 - starting with |
621 Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).getMess
ageArray(messages, {}); | 621 // Gecko 19 this function returns the result, before that it wrote to a |
622 messages = messages.value || []; | 622 // parameter. |
| 623 let outparam = {}; |
| 624 let messages = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleS
ervice).getMessageArray(outparam, {}); |
| 625 messages = messages || outparam.value || []; |
623 messages = messages.filter(function(message) | 626 messages = messages.filter(function(message) |
624 { | 627 { |
625 return (message instanceof Ci.nsIScriptError && | 628 return (message instanceof Ci.nsIScriptError && |
626 !/^https?:/i.test(message.sourceName) && | 629 !/^https?:/i.test(message.sourceName) && |
627 (/adblock/i.test(message.errorMessage) || /adblock/i.test(message.sour
ceName) || | 630 (/adblock/i.test(message.errorMessage) || /adblock/i.test(message.sour
ceName) || |
628 message.errorMessage.indexOf(addonID) >= 0 || message.sourceName.inde
xOf(addonID) >= 0)); | 631 message.errorMessage.indexOf(addonID) >= 0 || message.sourceName.inde
xOf(addonID) >= 0)); |
629 }); | 632 }); |
630 if (messages.length > 10) // Only the last 10 messages | 633 if (messages.length > 10) // Only the last 10 messages |
631 messages = messages.slice(messages.length - 10, messages.length); | 634 messages = messages.slice(messages.length - 10, messages.length); |
632 | 635 |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 | 1563 |
1561 function censorURL(url) | 1564 function censorURL(url) |
1562 { | 1565 { |
1563 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1566 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
1564 } | 1567 } |
1565 | 1568 |
1566 function encodeHTML(str) | 1569 function encodeHTML(str) |
1567 { | 1570 { |
1568 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); | 1571 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); |
1569 } | 1572 } |
OLD | NEW |