在移动设备上调试Web应用的控制台:js-mobile-console

jopen 10年前

js-mobile-console是一个可以在在移动设备上调试Web应用的控制台。MobileConsole可嵌入至任何网页中进行调试,可捕获错误和行为完全是原生JS控制台浏览器。它还可以通过window.console的API编写日志输出。
mobile_screen.png

用法

简单用法:

mobileConsole.show();

高级用法:

mobileConsole.options({      showOnError: true,      proxyConsole: false,      isCollapsed: true,      catchErrors: true  });

Conditional toggling:

if (condition) {      mobileConsole.show();  } else {      mobileConsole.hide();  }

API

  • show - show console with default options.
  • hide - hide console.
  • options - method to initialize console, by default will show console, accepts hash of options.

Options

  • showOnError - Default false. Console will be hidden if no show method was called, but it will appear if any error occurs.
  • proxyConsole - Default true. Determines if window.console methods are proxied to mobile console.
  • isCollapsed - Default false. Determines if Console is collpased on startup.
  • catchErrors - Default false. Determines if Console is registring window.onerror method in order to catch errors.

项目主页:http://www.open-open.com/lib/view/home/1415324245855