Skip to content

Console for mobile browser 手机浏览器控制台 webview调试f12

Notifications You must be signed in to change notification settings

wushufen/console.js

Repository files navigation

console.js

Console for mobile browser or webview

Features

  • console logs
  • log's traces
  • document tree
  • show element's box and path
  • storages (localStorage, sessionStorage, document.cookie)
  • ajax (xhr, fetch)
  • runtime errors
  • resource errors
  • uncaught promises
  • window, screen, navigator, history
  • run js
  • $0, ..., $9 (click element)
  • temp1 (click object)
  • call function (click function)
  • input again (click code)
  • print promise (auto await)

USAGE

  1. install
<script src="https://cdn.jsdelivr.net/gh/wusfen/console.js@master/dist/console.js"></script>
  1. open
  • by url: ?f12 &f12 #f12
http://domain.com/usage.html#f12
  • by code
console.f12 = 1 // show [f12] button
console.f12 = 2 // open console view

PREVIEW

https://wushufen.github.io/console.js/example/example.html

console

INSTALL BY JS

!(function () {
  if (/[?&#]f12\b/.test(location.href)) {
    // sync
    document.write(
      '<script f12 src=https://cdn.jsdelivr.net/gh/wushufen/console.js@master/dist/console.js></script>'
    )

    // async
    if (!document.querySelector('[f12]')) {
      var s = document.createElement('script')
      s.src =
        'https://cdn.jsdelivr.net/gh/wushufen/console.js@master/dist/console.js'
      document.body.appendChild(s)
    }
  }
})()