在移動設備上調試Web應用的控制臺:js-mobile-console
js-mobile-console是一個可以在在移動設備上調試Web應用的控制臺。MobileConsole可嵌入至任何網頁中進行調試,可捕獲錯誤和行為完全是原生JS控制臺瀏覽器。它還可以通過window.console的API編寫日志輸出。
用法
簡單用法:
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.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!