1
0
mirror of synced 2025-12-08 22:58:46 +08:00

Compare commits

...

11 Commits

Author SHA1 Message Date
redhoodsu
42150dc7c3 release: v3.0.1 2023-07-18 20:05:02 +08:00
redhoodsu
97122c86db fix: mouse event on touch device 2023-07-18 19:52:22 +08:00
Sekedus
8a200d45e6 example: add plugin 2023-07-17 18:55:00 +08:00
Mathias Bynens
7d9b8c4e8b Update README_CN.md 2023-07-17 18:53:24 +08:00
Mathias Bynens
6d3122c991 Tweak bookmarklet
It’s strictly better to always explicitly use https:// (instead of protocol-relative URLs) for resources that are available over that protocol.
2023-07-17 18:53:24 +08:00
redhoodsu
572917e2de Merge branch 'master' of https://github.com/liriliri/eruda 2023-07-04 13:13:38 +08:00
redhoodsu
df55c668d1 chore: small changes 2023-07-04 13:13:30 +08:00
surunzi
a1a75efa5e fix: #349 2023-07-04 00:33:39 +08:00
redhoodsu
e24e304c92 chore: small changes 2023-05-27 19:36:03 +08:00
于京刚
05da2498af feat: Copy the request data in the network details 2023-05-14 12:15:15 +08:00
surunzi
bbb38ba088 docs: update screenshot 2023-04-04 00:34:24 +08:00
10 changed files with 40 additions and 20 deletions

View File

@@ -1,3 +1,9 @@
## 3.0.1 (18 JUL 2023)
* fix: can not print string with %o [#336](https://github.com/liriliri/eruda/issues/336)
* fix: mouse event on touch device [#302](https://github.com/liriliri/eruda/issues/302)
* fix: unable to remove snippets [#349](https://github.com/liriliri/eruda/issues/349)
## 3.0.0 (2 Apr 2023)
* feat: replace fps and memory with monitor plugin

View File

@@ -27,7 +27,7 @@ Console for Mobile Browsers.
[license-image]: https://img.shields.io/npm/l/eruda?style=flat-square
[donate-image]: https://img.shields.io/badge/$-donate-0070ba.svg?style=flat-square
<img src="https://eruda.liriliri.io/img/screenshot.jpg" style="width:100%">
<img src="https://eruda.liriliri.io/img/screenshot-v3.jpg" style="width:100%">
[中文](README_CN.md)
@@ -40,7 +40,7 @@ Browse it on your phone: [https://eruda.liriliri.io/](https://eruda.liriliri.io/
In order to try it for different sites, execute the script below on browser address bar.
```javascript
javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init() } })();
javascript:(function () { var script = document.createElement('script'); script.src="https://cdn.jsdelivr.net/npm/eruda"; document.body.append(script); script.onload = function () { eruda.init(); } })();
```
## Features
@@ -138,4 +138,4 @@ If you want to create a plugin yourself, follow the guides [here](./doc/PLUGIN.m
## Contribution
Read [Contributing Guide](.github/CONTRIBUTING.md) for development setup instructions.
Read [Contributing Guide](.github/CONTRIBUTING.md) for development setup instructions.

View File

@@ -27,7 +27,7 @@
[license-image]: https://img.shields.io/npm/l/eruda?style=flat-square
[donate-image]: https://img.shields.io/badge/$-donate-0070ba.svg?style=flat-square
<img src="https://eruda.liriliri.io/img/screenshot.jpg" style="width:100%">
<img src="https://eruda.liriliri.io/img/screenshot-v3.jpg" style="width:100%">
## Demo
@@ -38,7 +38,7 @@
如果想在其它页面尝试,请在浏览器地址栏上输入以下代码。
```javascript
javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init() } })();
javascript:(function () { var script = document.createElement('script'); script.src="https://cdn.jsdelivr.net/npm/eruda"; document.body.append(script); script.onload = function () { eruda.init(); } })();
```
## 功能清单

View File

@@ -1,5 +1,5 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
exports = require('./webpack.prod')

View File

@@ -86,6 +86,8 @@ Add tool.
eruda.add(new (eruda.Tool.extend({
name: 'test'
})));
eruda.add(eruda.Network);
```
## remove
@@ -111,4 +113,4 @@ Hide eruda panel.
```javascript
eruda.hide();
```
```

View File

@@ -1,10 +1,10 @@
{
"name": "eruda",
"version": "3.0.0",
"version": "3.0.1",
"description": "Console for Mobile Browsers",
"main": "eruda.js",
"browserslist": [
"> 0.25%",
"since 2015",
"not dead"
],
"scripts": {
@@ -16,9 +16,9 @@
"format": "lsla prettier \"*.{js,ts}\" \"src/**/*.{js,scss,css}\" \"build/*.js\" \"test/*.{js,html}\" --write",
"lint": "eslint src/**/*.js",
"lint:fix": "npm run lint -- --fix",
"es5": "es-check es5 dist/eruda.js",
"es5": "es-check es5 dist/eruda.js dist/eruda-polyfill.js",
"setup": "lsla shx mkdir -p test/lib && lsla shx cp node_modules/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js} test/lib && lsla shx cp node_modules/jasmine-jquery/lib/jasmine-jquery.js test/lib && lsla shx cp node_modules/jquery/dist/jquery.js test/lib",
"genIcon": "lsla genIcon --input src/style/icon --output src/style/icon.css --name eruda-icon && prettier src/**/*.css --write"
"genIcon": "lsla genIcon --input src/style/icon --output src/style/icon.css --name eruda-icon && lsla prettier src/**/*.css --write"
},
"repository": {
"type": "git",
@@ -62,10 +62,10 @@
"karma-jquery": "^0.2.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^5.0.0",
"licia": "^1.38.0",
"licia": "^1.38.2",
"luna-box-model": "^0.1.0",
"luna-console": "^1.3.0",
"luna-data-grid": "^0.4.3",
"luna-console": "^1.3.3",
"luna-data-grid": "^0.5.1",
"luna-dom-viewer": "^1.2.3",
"luna-modal": "^1.0.0",
"luna-notification": "^0.1.4",

View File

@@ -17,6 +17,7 @@
.resizer {
position: absolute;
width: 100%;
touch-action: none;
left: 0;
top: -8px;
cursor: row-resize;

View File

@@ -101,6 +101,10 @@ export default class Detail extends Emitter {
const detailData = this._detailData
let data = `${detailData.method} ${detailData.url} ${detailData.status}\n`
if (!isEmpty(detailData.data)) {
data += '\nRequest Data\n\n'
data += `${detailData.data}\n`
}
if (!isEmpty(detailData.reqHeaders)) {
data += '\nRequest Headers\n\n'
each(detailData.reqHeaders, (val, key) => (data += `${key}: ${val}\n`))

View File

@@ -4,6 +4,7 @@ import $ from 'licia/$'
import each from 'licia/each'
import escape from 'licia/escape'
import map from 'licia/map'
import remove from 'licia/remove'
import evalCss from '../lib/evalCss'
import { classPrefix as c } from '../lib/util'
@@ -36,11 +37,7 @@ export default class Snippets extends Tool {
return this
}
remove(name) {
const snippets = this._snippets
for (let i = 0, len = snippets.length; i < len; i++) {
if (snippets[i].name === name) snippets.splice(i, 1)
}
remove(this._snippets, (snippet) => snippet.name === name)
this._render()

View File

@@ -151,6 +151,7 @@ function processClass(str) {
}
const hasTouchSupport = 'ontouchstart' in root
const hasPointerSupport = 'PointerEvent' in root
const touchEvents = {
start: 'touchstart',
move: 'touchmove',
@@ -161,8 +162,17 @@ const mouseEvents = {
move: 'mousemove',
end: 'mouseup',
}
const pointerEvents = {
start: 'pointerdown',
move: 'pointermove',
end: 'pointerup',
}
export function drag(name) {
if (hasPointerSupport) {
return pointerEvents[name]
}
return hasTouchSupport ? touchEvents[name] : mouseEvents[name]
}