mirror of
https://github.com/liriliri/eruda.git
synced 2026-02-02 09:49:00 +08:00
Add: Console api doc
This commit is contained in:
16
README.md
16
README.md
@@ -33,14 +33,14 @@ javascript:(function () { var script = document.createElement('script'); script.
|
||||
|
||||
## Features
|
||||
|
||||
* Console: Display JavaScript logs.
|
||||
* Elements: Check dom state.
|
||||
* Network: Show performance timing, ajax requests status.
|
||||
* Resource: Show localStorage, cookie information.
|
||||
* Info: Show url, user agent info.
|
||||
* Snippets: Include snippets used most often.
|
||||
* Sources: Html, js, css source viewer.
|
||||
* Features: Browser feature detections.
|
||||
* [Console](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#console): Display JavaScript logs.
|
||||
* [Elements](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#elements): Check dom state.
|
||||
* [Network](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#network): Show performance timing, ajax requests status.
|
||||
* [Resource](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#resources): Show localStorage, cookie information.
|
||||
* [Info](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#info): Show url, user agent info.
|
||||
* [Snippets](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#snippets): Include snippets used most often.
|
||||
* [Sources](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#sources): Html, js, css source viewer.
|
||||
* [Features](https://github.com/liriliri/eruda/blob/master/doc/Tool_Api.md#features): Browser feature detections.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
# Tool Api
|
||||
|
||||
Each default tool provided by eruda can be accessed by `eruda.get('Tool Name')`.
|
||||
|
||||
## Console
|
||||
|
||||
Displays console logs. Implementation detail follows the [console api spec](https://github.com/DeveloperToolsWG/console-object/blob/master/api.md).
|
||||
|
||||
### log, error, info, warn, dir, time/timeEnd, clear, count, assert, table
|
||||
|
||||
All these methods can be used in the same way as window.console object.
|
||||
|
||||
```javascript
|
||||
var console = eruda.get('console');
|
||||
console.log('eruda is a console for %s.', 'mobile browsers');
|
||||
console.table([{test: 1}, {test: 2, test2: 3}], 'test');
|
||||
```
|
||||
|
||||
## Elements
|
||||
|
||||
## Network
|
||||
@@ -16,4 +30,4 @@
|
||||
|
||||
## Features
|
||||
|
||||
## Settings
|
||||
## Settings
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eruda",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"description": "Console for Mobile Browsers",
|
||||
"main": "eruda.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -220,7 +220,7 @@ export default class Network extends Tool
|
||||
|
||||
data.push(getData('Total', navigationStart, loadEventEnd));
|
||||
data.push(getData('Network/Server', navigationStart, responseStart));
|
||||
data.push(getData('App cache', fetchStart, domainLookupStart));
|
||||
data.push(getData('App Cache', fetchStart, domainLookupStart));
|
||||
data.push(getData('DNS', domainLookupStart, domainLookupEnd));
|
||||
data.push(getData('TCP', connectStart, connectEnd));
|
||||
data.push(getData('Time to First Byte', requestStart, responseStart));
|
||||
|
||||
@@ -126,6 +126,6 @@ function createEl(key, val, firstLevel)
|
||||
}
|
||||
|
||||
|
||||
const LIGHTER_KEY = ['__proto__', 'constructor', 'toString', 'valueOf'];
|
||||
const LIGHTER_KEY = ['__proto__', 'constructor', 'toString', 'valueOf', 'length'];
|
||||
|
||||
var encode = str => util.escape(util.toStr(str));
|
||||
Reference in New Issue
Block a user