diff --git a/CHANGELOG.md b/CHANGELOG.md index 29229c6b..83e7dbd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.15.2 (17 Oct 2024) + +* fix: ws dead loop + ## 1.15.1 (16 Oct 2024) * fix: cache network requests before enable [#53](https://github.com/liriliri/chii/issues/53) diff --git a/package.json b/package.json index 867aa604..63fd6663 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chii", - "version": "1.15.1", + "version": "1.15.2", "description": "Chrome devtools framework", "main": "./server/index.js", "bin": { @@ -42,7 +42,7 @@ "devDependencies": { "@eslint/js": "^9.5.0", "@types/eslint__js": "^8.42.3", - "chobitsu": "^1.8.2", + "chobitsu": "^1.8.3", "css-loader": "^6.7.2", "es-check": "^6.2.1", "eslint": "^8.57.0", diff --git a/src/target/DevtoolsFrame.ts b/src/target/DevtoolsFrame.ts index 1a677d85..947fdd56 100644 --- a/src/target/DevtoolsFrame.ts +++ b/src/target/DevtoolsFrame.ts @@ -117,30 +117,30 @@ export default class DevtoolsFrame { resourceTreeModel ); } - }); - sendToDevtools({ - method: 'Page.frameNavigated', - params: { - frame: { - id: '1', - mimeType: 'text/html', - securityOrigin: location.origin, - url: location.href, + sendToDevtools({ + method: 'Page.frameNavigated', + params: { + frame: { + id: '1', + mimeType: 'text/html', + securityOrigin: location.origin, + url: location.href, + }, + type: 'Navigation', }, - type: 'Navigation', - }, + }); + sendToChobitsu({ method: 'Network.enable' }); + sendToDevtools({ method: 'Runtime.executionContextsCleared' }); + sendToChobitsu({ method: 'Runtime.enable' }); + sendToChobitsu({ method: 'Debugger.enable' }); + sendToChobitsu({ method: 'DOMStorage.enable' }); + sendToChobitsu({ method: 'DOM.enable' }); + sendToChobitsu({ method: 'CSS.enable' }); + sendToChobitsu({ method: 'Overlay.enable' }); + sendToDevtools({ method: 'DOM.documentUpdated' }); + sendToChobitsu({ method: 'Page.enable' }); + sendToDevtools({ method: 'Page.loadEventFired' }); }); - sendToChobitsu({ method: 'Network.enable' }); - sendToDevtools({ method: 'Runtime.executionContextsCleared' }); - sendToChobitsu({ method: 'Runtime.enable' }); - sendToChobitsu({ method: 'Debugger.enable' }); - sendToChobitsu({ method: 'DOMStorage.enable' }); - sendToChobitsu({ method: 'DOM.enable' }); - sendToChobitsu({ method: 'CSS.enable' }); - sendToChobitsu({ method: 'Overlay.enable' }); - sendToDevtools({ method: 'DOM.documentUpdated' }); - sendToChobitsu({ method: 'Page.enable' }); - sendToDevtools({ method: 'Page.loadEventFired' }); }); } else { frame.src = `${devtoolsUrl}#?embedded=${encodeURIComponent(hostOrigin)}`; diff --git a/src/target/connectRtc.ts b/src/target/connectRtc.ts index c6bd5cc8..ddbe5882 100644 --- a/src/target/connectRtc.ts +++ b/src/target/connectRtc.ts @@ -42,6 +42,7 @@ export default async function () { title: (window as any).ChiiTitle || document.title || 'Unknown', favicon: getFavicon(), rtc: true, + '__chobitsu-hide__': true, })}` ); diff --git a/src/target/connectServer.ts b/src/target/connectServer.ts index 040b89a0..b3ad0321 100644 --- a/src/target/connectServer.ts +++ b/src/target/connectServer.ts @@ -23,6 +23,7 @@ export default function () { url: location.href, title: (window as any).ChiiTitle || document.title, favicon: getFavicon(), + '__chobitsu-hide__': true, })}` );