Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @fileoverview Error handling APIs and listeners. | |
| 7 */ | |
| 8 | |
| 9 goog.provide('__crWeb.error'); | |
| 10 | |
| 11 goog.require('__crWeb.message'); | |
| 12 | |
| 13 /** Beginning of anonymouse object */ | |
| 14 (function() { | |
| 15 | |
| 16 /** | |
| 17 * JavaScript errors are logged on the main application side. The handler is | |
| 18 * added ASAP to catch any errors in startup. Note this does not appear to | |
|
Eugene But (OOO till 7-30)
2017/04/13 16:30:06
Could you please drop "Note this does not appear t
danyao
2017/04/13 17:40:45
Done.
| |
| 19 * work in iOS < 5. | |
| 20 */ | |
| 21 window.addEventListener('error', function(event) { | |
| 22 // Sadly, event.filename and event.lineno are always 'undefined' and '0' | |
|
Eugene But (OOO till 7-30)
2017/04/13 16:30:06
WKWebView may support this now. Could you please f
danyao
2017/04/13 17:40:45
Done.
| |
| 23 // with UIWebView. | |
| 24 __gCrWeb.message.invokeOnHost( | |
| 25 {'command': 'window.error', 'message': event.message.toString()}); | |
| 26 }); | |
| 27 | |
| 28 // Flush the message queue. | |
| 29 if (__gCrWeb.message) { | |
| 30 __gCrWeb.message.invokeQueues(); | |
| 31 } | |
| 32 | |
| 33 }()); // End of anonymous object | |
| OLD | NEW |