Skip to content

Commit 097457c

Browse files
committed
release: v1.8.3
1 parent 3cae0ed commit 097457c

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

.eslintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"node": true
66
},
77
"parser": "@typescript-eslint/parser",
8-
"plugins": [
9-
"@typescript-eslint"
10-
],
8+
"plugins": ["@typescript-eslint"],
119
"extends": [
1210
"eslint:recommended",
1311
"plugin:@typescript-eslint/recommended",

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.8.3 (17 Oct 2024)
2+
3+
* fix: ignore special ws connection
4+
15
## 1.8.2 (15 Oct 2024)
26

37
* fix: cache network requests before enable

devtools/network.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ function testWs() {
3232
setTimeout(() => {
3333
ws.close()
3434
}, 1000)
35+
36+
const wsIgnore = new WebSocket(
37+
'wss://echo.websocket.org?__chobitsu-hide__=true'
38+
)
39+
40+
wsIgnore.onopen = function () {
41+
wsIgnore.send(text)
42+
wsIgnore.send(enc.encode(text))
43+
}
44+
setTimeout(() => {
45+
wsIgnore.close()
46+
}, 1000)
3547
}
3648

3749
testFetch()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chobitsu",
3-
"version": "1.8.2",
3+
"version": "1.8.3",
44
"description": "Chrome devtools protocol JavaScript implementation",
55
"main": "dist/chobitsu.js",
66
"exports": {

src/domains/Network.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ function enableWebSocket() {
189189
const origWebSocket = window.WebSocket
190190
function WebSocket(url: string, protocols?: string | string[]) {
191191
const ws = new origWebSocket(url, protocols)
192+
193+
if (!isValidUrl(url)) {
194+
return ws
195+
}
196+
192197
const requestId = createId()
193198

194199
trigger('Network.webSocketCreated', {

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
devServer: {
1818
static: {
1919
directory: path.join(__dirname, 'devtools'),
20+
watch: false,
2021
},
2122
port: 8080,
2223
},

0 commit comments

Comments
 (0)