Skip to content

Commit

Permalink
release: v1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Oct 17, 2024
1 parent 3cae0ed commit 097457c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.3 (17 Oct 2024)

* fix: ignore special ws connection

## 1.8.2 (15 Oct 2024)

* fix: cache network requests before enable
Expand Down
12 changes: 12 additions & 0 deletions devtools/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ function testWs() {
setTimeout(() => {
ws.close()
}, 1000)

const wsIgnore = new WebSocket(
'wss://echo.websocket.org?__chobitsu-hide__=true'
)

wsIgnore.onopen = function () {
wsIgnore.send(text)
wsIgnore.send(enc.encode(text))
}
setTimeout(() => {
wsIgnore.close()
}, 1000)
}

testFetch()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chobitsu",
"version": "1.8.2",
"version": "1.8.3",
"description": "Chrome devtools protocol JavaScript implementation",
"main": "dist/chobitsu.js",
"exports": {
Expand Down
5 changes: 5 additions & 0 deletions src/domains/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ function enableWebSocket() {
const origWebSocket = window.WebSocket
function WebSocket(url: string, protocols?: string | string[]) {
const ws = new origWebSocket(url, protocols)

if (!isValidUrl(url)) {
return ws
}

const requestId = createId()

trigger('Network.webSocketCreated', {
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
devServer: {
static: {
directory: path.join(__dirname, 'devtools'),
watch: false,
},
port: 8080,
},
Expand Down

0 comments on commit 097457c

Please sign in to comment.