Skip to content

Commit 9ecb77c

Browse files
committed
Merge commit '956ffee007482b17fb3c1b1d05aaf523d0abbe12' as 'chobitsu'
2 parents 3d123d3 + 956ffee commit 9ecb77c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4976
-0
lines changed

chobitsu/.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"plugins": ["@typescript-eslint"],
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier"
13+
],
14+
"rules": {
15+
"@typescript-eslint/no-explicit-any": "off",
16+
"prefer-rest-params": "off",
17+
"@typescript-eslint/no-this-alias": "off",
18+
"@typescript-eslint/no-var-requires": "off",
19+
"@typescript-eslint/no-require-imports": "off",
20+
"@typescript-eslint/no-unused-vars": "off",
21+
"prefer-spread": "off"
22+
}
23+
}

chobitsu/.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ko_fi: surunzi
2+
custom: [surunzi.com/wechatpay.html]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'master'
8+
paths:
9+
- 'src/**/*'
10+
- 'test/**/*'
11+
12+
jobs:
13+
ci:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: '18.x'
22+
- run: |
23+
npm i
24+
npm run ci
25+
- uses: codecov/codecov-action@v4
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }} # required
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to NPM
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '18.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- run: |
18+
npm i
19+
npm run build
20+
- run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

chobitsu/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
devtools/.cipd
5+
devtools/devtools-frontend
6+
devtools/.gclient_entries
7+
devtools/.gclient_previous_sync_commits
8+
package-lock.json

chobitsu/CHANGELOG.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
## 1.8.4 (18 Oct 2024)
2+
3+
* fix: css priority [#16](https://github.com/liriliri/chobitsu/issues/16)
4+
5+
## 1.8.3 (17 Oct 2024)
6+
7+
* fix: ignore special ws connection
8+
9+
## 1.8.2 (15 Oct 2024)
10+
11+
* fix: cache network requests before enable
12+
* fix: fetch remains pending when error occurs [#10](https://github.com/liriliri/chobitsu/issues/10)
13+
14+
## 1.8.1 (27 Sep 2024)
15+
16+
* fix: shadowRoot hook
17+
18+
## 1.8.0 (26 Sep 2024)
19+
20+
* feat: support shadow dom
21+
22+
## 1.7.1 (3 Sep 2024)
23+
24+
* fix: error caused by accessing object properties
25+
26+
## 1.7.0 (28 Aug 2024)
27+
28+
* feat: support latest devtools
29+
30+
## 1.6.0 (20 Aug 2024)
31+
32+
* feat: emulateTouchFromMouseEvent
33+
34+
## 1.5.1 (10 Aug 2024)
35+
36+
* fix: WebSocket message base64 encoded
37+
38+
## 1.5.0 (31 Jul 2024)
39+
40+
* feat: support IndexedDB
41+
* feat: support WebSocket
42+
43+
## 1.4.6 (4 Nov 2023)
44+
45+
* fix: cache console logs before enable
46+
* fix: console complete
47+
48+
## 1.4.5 (1 Apr 2023)
49+
50+
* fix: some console errors
51+
52+
## 1.4.4 (20 Dec 2022)
53+
54+
* fix: select element on mobile
55+
56+
## 1.4.3 (17 Dec 2022)
57+
58+
* feat: support DOM.getNode
59+
60+
## 1.4.2 (11 Dec 2022)
61+
62+
* fix: dom highlighter style encapsulation
63+
64+
## 1.4.1 (2 Dec 2022)
65+
66+
* feat: support android 5.0
67+
68+
## 1.4.0 (27 Nov 2022)
69+
70+
* feat: support ie11
71+
72+
## 1.3.1 (21 Nov 2022)
73+
74+
* fix: css variable and selector with comma #7
75+
76+
## 1.3.0 (15 Aug 2022)
77+
78+
* feat: proxy support
79+
80+
## 1.2.1 (7 Aug 2022)
81+
82+
* fix: css text empty if value contains special char
83+
* refactor: replace dom-to-image with html2canvas
84+
85+
## 1.2.0 (31 Jul 2022)
86+
87+
* feat: support screencast
88+
89+
## 1.1.1 (30 Jul 2022)
90+
91+
* fix: Page.getResourceTree url
92+
93+
## 1.1.0 (27 Jul 2022)
94+
95+
* feat: sources support
96+
97+
## 1.0.1 (26 Jul 2022)
98+
99+
* fix: redundant error log

chobitsu/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020-present liriliri
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

chobitsu/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# chobitsu
2+
3+
[![NPM version][npm-image]][npm-url]
4+
[![Build status][ci-image]][ci-url]
5+
[![Test coverage][codecov-image]][codecov-url]
6+
[![License][license-image]][npm-url]
7+
8+
[npm-image]: https://img.shields.io/npm/v/chobitsu?style=flat-square
9+
[npm-url]: https://npmjs.org/package/chobitsu
10+
[ci-image]: https://img.shields.io/github/actions/workflow/status/liriliri/chobitsu/main.yml?branch=master&style=flat-square
11+
[ci-url]: https://github.com/liriliri/chobitsu/actions/workflows/main.yml
12+
[codecov-image]: https://img.shields.io/codecov/c/github/liriliri/chobitsu?style=flat-square
13+
[codecov-url]: https://codecov.io/github/liriliri/chobitsu?branch=master
14+
[license-image]: https://img.shields.io/npm/l/chobitsu?style=flat-square
15+
16+
[Chrome devtools protocol](https://chromedevtools.github.io/devtools-protocol/) JavaScript implementation.
17+
18+
## Install
19+
20+
You can get it on npm.
21+
22+
```bash
23+
npm install chobitsu --save
24+
```
25+
26+
## Usage
27+
28+
```javascript
29+
const chobitsu = require('chobitsu');
30+
31+
chobitsu.setOnMessage(message => {
32+
console.log(message);
33+
});
34+
35+
chobitsu.sendRawMessage(JSON.stringify({
36+
id: 1,
37+
method: 'DOMStorage.clear',
38+
params: {
39+
storageId: {
40+
isLocalStorage: true,
41+
securityOrigin: 'http://example.com'
42+
}
43+
}
44+
}));
45+
```
46+
47+
For more detailed usage instructions, please read the documentation at [chii.liriliri.io](https://chii.liriliri.io/docs/chobitsu.html)!

chobitsu/devtools/.gclient

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
solutions = [
2+
{
3+
"name": "devtools-frontend",
4+
"url": "https://github.com/liriliri/devtools-frontend.git@origin/chii",
5+
"deps_file": "DEPS",
6+
"managed": False,
7+
"custom_deps": {},
8+
},
9+
]

chobitsu/devtools/db.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// https://gist.github.com/enjalot/6472041
2+
var indexedDB = window.indexedDB
3+
var open = indexedDB.open('MyDatabase', 1)
4+
open.onupgradeneeded = function () {
5+
var db = open.result
6+
var store = db.createObjectStore('MyObjectStore', { keyPath: 'id' })
7+
var index = store.createIndex('NameIndex', ['name.last', 'name.first'])
8+
}
9+
open.onsuccess = function () {
10+
var db = open.result
11+
var tx = db.transaction('MyObjectStore', 'readwrite')
12+
var store = tx.objectStore('MyObjectStore')
13+
var index = store.index('NameIndex')
14+
15+
store.put({ id: 12345, name: { first: 'John', last: 'Doe' }, age: 42 })
16+
store.put({ id: 67890, name: { first: 'Bob', last: 'Smith' }, age: 35 })
17+
18+
var getJohn = store.get(12345)
19+
var getBob = index.get(['Smith', 'Bob'])
20+
21+
getJohn.onsuccess = function () {
22+
console.log(getJohn.result.name.first) // => "John"
23+
}
24+
25+
getBob.onsuccess = function () {
26+
console.log(getBob.result.name.first) // => "Bob"
27+
}
28+
29+
tx.oncomplete = function () {
30+
db.close()
31+
}
32+
}

0 commit comments

Comments
 (0)