Where is the console API for WebKit / Safari?

WebKit / Safari supports a console object that is similar to Firebug. But what exactly is supported? There is documentation for Firebug , but where can I find console documentation for Safari / WebKit?

+62
javascript safari console
Sep 11 '08 at 1:23
source share
6 answers

Supported methods initially:

  • console.log()
  • console.error()
  • console.warn()
  • console.info()

Newer versions of WebKit also add the following methods that make the WebKit console API almost identical to the Firebug API :

  • console.count()
  • console.debug()
  • console.profileEnd()
  • console.trace()
  • console.dir()
  • console.dirxml()
  • console.assert()
  • console.time()
  • console.profile()
  • console.timeEnd()
  • console.group()
  • console.groupEnd()

(New information based on the nightly build of WebKit, WebKit-SVN-r37126, is not available in Safari at the time of writing)

+64
Sep 11 '08 at 1:39
source share

The console API has been documented by Apple in the Console section of the Safari Developer's Guide.

+26
Jan 29 '10 at 20:53 on
source share

I know this is an old and answered question, but you can also just open the console and type console.__proto__ , and you will get an extensible list of everything that it supports.

+13
Jan 15 '11 at 6:52
source share

Firebug Console API documentation moved here:

http://getfirebug.com/wiki/index.php/Console_API

+3
Aug 04 '10 at 17:46
source share

Try the following:

 console.dir(console) 
+3
May 16 '11 at 19:28
source share

The Console object has a built-in "API", in the form of a "private property", which you can discover by doing this in the javascript Webkit console

 > for(o in console) console.dir(o) _commandLineAPI log warn … 

_commandLineAPI:

 > console.dir(_commandLineAPI) CommandLineAPI $0: "—" $1: "—" $2: "—" $3: "—" $4: "—" $$: bound: function () { $x: bound: function (xpath, context) { clear: bound: function () { copy: bound: function (object) { dir: bound: function () { dirxml: bound: function () { inspect: bound: function (object) { keys: bound: function (object) { monitorEvents: bound: function (object, types) { profile: bound: function () { profileEnd: bound: function () { unmonitorEvents: bound: function (object, types) { values: bound: function (object) { __proto__: CommandLineAPI 
0
15 Jun. '12 at 12:08
source share



All Articles