watone Console for Mobile Browsers.
javascript:(function () { var script = document.createElement('script'); script.src="https://cdn.jsdelivr.net/npm/@watone/console"; document.body.append(script); script.onload = function () { wtConsole.init(); } })();
- Console: Display JavaScript logs.
- Elements: Check dom state.
- Network: Show requests status.
- Resources: Show localStorage, cookie information.
- Info: Show url, user agent info.
- Snippets: Include snippets used most often.
- Sources: Html, js, css source viewer.
You can get it on npm.
npm install @watone/console --save
# or
pnpm add @watone/console --save
# or
yarn install @watone/console --save
Add this script to your page.
<script src="node_modules/@watone/console/wtConsole.js"></script>
<script>wtConsole.init();</script>
It's also available on jsDelivr
<script src="//cdn.jsdelivr.net/npm/@watone/console"></script>
<script>wtConsole.init();</script>
The JavaScript file size is quite huge(about 100kb gzipped) and therefore not suitable to include in mobile pages. It's recommended to make sure wtConsole is loaded only when wtConsole is set to true on url(http://example.com/?wtConsole=true), for example:
;(function () {
var src = '//cdn.jsdelivr.net/npm/@watone/console';
if (!/wtConsole=true/.test(window.location) && localStorage.getItem('active-wtConsole') != 'true') return;
document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
document.write('<scr' + 'ipt>wtConsole.init();</scr' + 'ipt>');
})();
If you are using modern JavaScript tooling, you can dynamically import it.
if (import.meta.env.MODE === 'development') {
import('wtConsole').then(wtConsole => wtConsole.default.init());
}
When initialization, a configuration object can be passed in.
- container: Container element. If not set, it will append an element directly under html root element.
- tool: Choose which default tools you want, by default all will be added.
For more information, please check the documentation.
let el = document.createElement('div');
document.body.appendChild(el);
wtConsole.init({
container: el,
tool: ['console', 'elements']
});
- wtConsole-monitor: Display page fps and memory.
- wtConsole-features: Browser feature detections.
- wtConsole-timing: Show performance and resource timing.
- wtConsole-code: Run JavaScript code.
- wtConsole-benchmark: Run JavaScript benchmarks.
- wtConsole-geolocation: Test geolocation.
- wtConsole-orientation: Test orientation api.
- wtConsole-touches: Visualize screen touches.
If you want to create a plugin yourself, follow the guides here.
- wtConsole-android: Simple webview with wtConsole loaded automatically.
- chii: Remote debugging tool.
- chobitsu: Chrome devtools protocol JavaScript implementation.
- licia: Utility library used by wtConsole.
- luna: UI components used by wtConsole.
- vivy: Icon image generation.
- wtConsole-pixel: UI pixel restoration tool.
- wtConsole-webpack-plugin: wtConsole webpack plugin.
- wtConsole-vue-devtools: wtConsole Vue-devtools plugin.
Read Contributing Guide for development setup instructions.