Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: ios/web/web_state/js/resources/console.js

Issue 1029983002: Upstream ios/web/ JS files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/web_state/js/resources/common.js ('k') | ios/web/web_state/js/resources/core.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 // Scripts to allow page console.log() etc. output to be seen on the console
6 // of the host application.
7
8 goog.provide('__crweb.console');
9
10 /**
11 * Namespace for this module.
12 */
13 __gCrWeb.console = {};
14
15 /* Beginning of anonymous object. */
16 new function() {
17 function sendConsoleMessage(method, originalArguments) {
18 message = Array.prototype.slice.call(originalArguments).join(' ');
19 __gCrWeb.message.invokeOnHost({'command': 'console',
20 'method': method,
21 'message': message,
22 'origin': document.location.origin});
23 }
24
25 console.log = function() {
26 sendConsoleMessage('log', arguments);
27 };
28
29 console.debug = function() {
30 sendConsoleMessage('debug', arguments);
31 };
32
33 console.info = function() {
34 sendConsoleMessage('info', arguments);
35 };
36
37 console.warn = function() {
38 sendConsoleMessage('warn', arguments);
39 };
40
41 console.error = function() {
42 sendConsoleMessage('error', arguments);
43 };
44 }
OLDNEW
« no previous file with comments | « ios/web/web_state/js/resources/common.js ('k') | ios/web/web_state/js/resources/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698