| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 <title>Adblock Plus Errors</title> | 6 <title>Adblock Plus Errors</title> |
| 7 <style type="text/css"> | 7 <style type="text/css"> |
| 8 .warning, .error | 8 .warning, .error |
| 9 { | 9 { |
| 10 border: 1px dashed black; | 10 border: 1px dashed black; |
| 11 margin: 5px; | 11 margin: 5px; |
| 12 padding: 2px; | 12 padding: 2px; |
| 13 white-space: pre-wrap; | 13 white-space: pre-wrap; |
| 14 } | 14 } |
| 15 | 15 |
| 16 .error | 16 .error |
| 17 { | 17 { |
| 18 background-color: #fff0f0; | 18 background-color: #fff0f0; |
| 19 } | 19 } |
| 20 | 20 |
| 21 .warning | 21 .warning |
| 22 { | 22 { |
| 23 background-color: #ffffe0; | 23 background-color: #ffffe0; |
| 24 } | 24 } |
| 25 | 25 |
| 26 button | 26 button |
| 27 { | 27 { |
| 28 float: right; | 28 float: right; |
| 29 } | 29 } |
| 30 </style> | 30 </style> |
| 31 </head> | 31 </head> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 46 } | 46 } |
| 47 let {addonVersion, addonID} = require("info"); | 47 let {addonVersion, addonID} = require("info"); |
| 48 | 48 |
| 49 let text = "You are running Adblock Plus " + addonVersion; | 49 let text = "You are running Adblock Plus " + addonVersion; |
| 50 text += "."; | 50 text += "."; |
| 51 document.write("<p>" + text + "</p>"); | 51 document.write("<p>" + text + "</p>"); |
| 52 | 52 |
| 53 id = addonID.replace(/[\{\}]/g, ""); | 53 id = addonID.replace(/[\{\}]/g, ""); |
| 54 } catch (e) {} | 54 } catch (e) {} |
| 55 | 55 |
| 56 let messages = {}; | 56 // See https://bugzilla.mozilla.org/show_bug.cgi?id=664695 - starting with |
| 57 Components.classes["@mozilla.org/consoleservice;1"] | 57 // Gecko 19 this function returns the result, before that it wrote to a |
| 58 // parameter. |
| 59 let outparam = {}; |
| 60 let messages = Components.classes["@mozilla.org/consoleservice;1"] |
| 58 .getService(Components.interfaces.nsIConsoleService) | 61 .getService(Components.interfaces.nsIConsoleService) |
| 59 .getMessageArray(messages, {}); | 62 .getMessageArray(outparam, {}); |
| 60 messages = messages.value || []; | 63 messages = messages || outparam.value || []; |
| 61 | |
| 62 messages = messages.filter(function(message) | 64 messages = messages.filter(function(message) |
| 63 { | 65 { |
| 64 return (message instanceof Components.interfaces.nsIScriptError && | 66 return (message instanceof Components.interfaces.nsIScriptError && |
| 65 !/^https?:/i.test(message.sourceName) && | 67 !/^https?:/i.test(message.sourceName) && |
| 66 (/adblock/i.test(message.errorMessage) || /adblock/i.test(message.sour
ceName) || | 68 (/adblock/i.test(message.errorMessage) || /adblock/i.test(message.sour
ceName) || |
| 67 id && (message.errorMessage.indexOf(id) >= 0 || message.sourceName.in
dexOf(id) >= 0))); | 69 id && (message.errorMessage.indexOf(id) >= 0 || message.sourceName.in
dexOf(id) >= 0))); |
| 68 }); | 70 }); |
| 69 | 71 |
| 70 if (messages.length) | 72 if (messages.length) |
| 71 { | 73 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 99 function clearErrors() | 101 function clearErrors() |
| 100 { | 102 { |
| 101 Components.classes["@mozilla.org/consoleservice;1"] | 103 Components.classes["@mozilla.org/consoleservice;1"] |
| 102 .getService(Components.interfaces.nsIConsoleService) | 104 .getService(Components.interfaces.nsIConsoleService) |
| 103 .reset(); | 105 .reset(); |
| 104 window.location.reload(); | 106 window.location.reload(); |
| 105 } | 107 } |
| 106 </script> | 108 </script> |
| 107 </body> | 109 </body> |
| 108 </html> | 110 </html> |
| OLD | NEW |