| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 text = '(' + text + ')'; | 116 text = '(' + text + ')'; |
| 117 | 117 |
| 118 executionContext.evaluate(text, 'console', useCommandLineAPI, false, false,
true, true, printResult); | 118 executionContext.evaluate(text, 'console', useCommandLineAPI, false, false,
true, true, printResult); |
| 119 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated); | 119 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated); |
| 120 } | 120 } |
| 121 | 121 |
| 122 /** | 122 /** |
| 123 * @param {!SDK.ConsoleMessage} msg | 123 * @param {!SDK.ConsoleMessage} msg |
| 124 */ | 124 */ |
| 125 addMessage(msg) { | 125 addMessage(msg) { |
| 126 if (this._isBlacklisted(msg)) | |
| 127 return; | |
| 128 | |
| 129 if (msg.source === SDK.ConsoleMessage.MessageSource.Worker && msg.target().s
ubTargetsManager && | 126 if (msg.source === SDK.ConsoleMessage.MessageSource.Worker && msg.target().s
ubTargetsManager && |
| 130 msg.target().subTargetsManager.targetForId(msg.workerId)) | 127 msg.target().subTargetsManager.targetForId(msg.workerId)) |
| 131 return; | 128 return; |
| 132 | 129 |
| 133 if (msg.source === SDK.ConsoleMessage.MessageSource.ConsoleAPI && msg.type =
== SDK.ConsoleMessage.MessageType.Clear) | 130 if (msg.source === SDK.ConsoleMessage.MessageSource.ConsoleAPI && msg.type =
== SDK.ConsoleMessage.MessageType.Clear) |
| 134 this.clear(); | 131 this.clear(); |
| 135 | 132 |
| 136 this._messages.push(msg); | 133 this._messages.push(msg); |
| 137 if (msg._exceptionId) | 134 if (msg._exceptionId) |
| 138 this._messageByExceptionId.set(msg._exceptionId, msg); | 135 this._messageByExceptionId.set(msg._exceptionId, msg); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 162 case SDK.ConsoleMessage.MessageLevel.Warning: | 159 case SDK.ConsoleMessage.MessageLevel.Warning: |
| 163 this._warnings++; | 160 this._warnings++; |
| 164 break; | 161 break; |
| 165 case SDK.ConsoleMessage.MessageLevel.Error: | 162 case SDK.ConsoleMessage.MessageLevel.Error: |
| 166 this._errors++; | 163 this._errors++; |
| 167 break; | 164 break; |
| 168 } | 165 } |
| 169 } | 166 } |
| 170 | 167 |
| 171 /** | 168 /** |
| 172 * @param {!SDK.ConsoleMessage} msg | |
| 173 * @return {boolean} | |
| 174 */ | |
| 175 _isBlacklisted(msg) { | |
| 176 if (msg.source !== SDK.ConsoleMessage.MessageSource.Network || | |
| 177 msg.level !== SDK.ConsoleMessage.MessageLevel.Error || !msg.url || !msg.
url.startsWith('chrome-extension')) | |
| 178 return false; | |
| 179 | |
| 180 // ignore Chromecast's cast_sender spam | |
| 181 if (msg.url.includes('://boadgeojelhgndaghljhdicfkmllpafd') || | |
| 182 msg.url.includes('://dliochdbjfkdbacpmhlcpmleaejidimm') || | |
| 183 msg.url.includes('://pkedcjkdefgpdelpbcmbmeomcjbeemfm') || | |
| 184 msg.url.includes('://fjhoaacokmgbjemoflkofnenfaiekifl') || | |
| 185 msg.url.includes('://fmfcbgogabcbclcofgocippekhfcmgfj') || | |
| 186 msg.url.includes('://enhhojjnijigcajfphajepfemndkmdlo') || | |
| 187 msg.url.includes('://ekpaaapppgpmolpcldedioblbkmijaca')) | |
| 188 return true; | |
| 189 | |
| 190 return false; | |
| 191 } | |
| 192 | |
| 193 /** | |
| 194 * @return {!Array.<!SDK.ConsoleMessage>} | 169 * @return {!Array.<!SDK.ConsoleMessage>} |
| 195 */ | 170 */ |
| 196 messages() { | 171 messages() { |
| 197 return this._messages; | 172 return this._messages; |
| 198 } | 173 } |
| 199 | 174 |
| 200 requestClearMessages() { | 175 requestClearMessages() { |
| 201 this._logAgent && this._logAgent.clear(); | 176 this._logAgent && this._logAgent.clear(); |
| 202 this.clear(); | 177 this.clear(); |
| 203 } | 178 } |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 */ | 607 */ |
| 633 _commandEvaluated(event) { | 608 _commandEvaluated(event) { |
| 634 this.dispatchEventToListeners(SDK.ConsoleModel.Events.CommandEvaluated, even
t.data); | 609 this.dispatchEventToListeners(SDK.ConsoleModel.Events.CommandEvaluated, even
t.data); |
| 635 } | 610 } |
| 636 }; | 611 }; |
| 637 | 612 |
| 638 /** | 613 /** |
| 639 * @type {!SDK.MultitargetConsoleModel} | 614 * @type {!SDK.MultitargetConsoleModel} |
| 640 */ | 615 */ |
| 641 SDK.multitargetConsoleModel; | 616 SDK.multitargetConsoleModel; |
| OLD | NEW |