Skip to content

Commit

Permalink
Fix inspector on nodejs v20
Browse files Browse the repository at this point in the history
Fixes #433
  • Loading branch information
laverdet committed Jan 11, 2024
1 parent 266d9e8 commit 7f70d25
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inspector-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ wss.on('connection', function(ws) {
channel.onResponse = (callId, message) => send(message);
channel.onNotification = send;
});
console.log('Inspector: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:10000');
console.log('Inspector: devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:10000');
4 changes: 4 additions & 0 deletions src/isolate/inspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ void InspectorAgent::quitMessageLoopOnPause() {
*/
auto InspectorAgent::ConnectSession(InspectorSession& session) -> unique_ptr<V8InspectorSession> {
active_sessions.write()->insert(&session);
#if V8_AT_LEAST(10, 3, 118)
return inspector->connect(1, &session, StringView(), v8_inspector::V8Inspector::ClientTrustLevel::kFullyTrusted);
#elif
return inspector->connect(1, &session, StringView());
#endif
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/isolate/v8_inspector_wrapper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once
#include "node_wrapper.h"
#include "./v8_version.h"
#if V8_AT_LEAST(10, 2, 154)
#if V8_AT_LEAST(11, 3, 244)
#include "v8_inspector/nodejs_v20.0.0.h"
#elif V8_AT_LEAST(10, 2, 154)
#include "v8_inspector/nodejs_v18.3.0.h"
#elif V8_AT_LEAST(10, 1, 124)
#include "v8_inspector/nodejs_v18.0.0.h"
Expand Down
Loading

0 comments on commit 7f70d25

Please sign in to comment.