Where is the console API for WebKit/Safari?

前端 未结 7 1531
南方客
南方客 2020-12-12 11:19

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

7条回答
  •  温柔的废话
    2020-12-12 12:00

    The Console object appearantly has a built-in 'API', in the form of a 'private property' you can reveal by doing this in the Webkit javascript-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
    

提交回复
热议问题