Skip to content

Commit 396d5a7

Browse files
authored
fix: hide internal call from inspector log (#783) (#784)
1 parent f19ceca commit 396d5a7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

playwright/src/main/java/com/microsoft/playwright/impl/Connection.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ private WaitableResult<JsonElement> internalSendMessage(String guid, String meth
121121
message.addProperty("method", method);
122122
message.add("params", params);
123123
JsonObject metadata = new JsonObject();
124-
if (stackTraceCollector != null) {
125-
metadata.add("stack", stackTraceCollector.currentStackTrace());
126-
}
127-
if (apiName != null) {
124+
if (apiName == null) {
125+
metadata.addProperty("internal", true);
126+
} else {
128127
metadata.addProperty("apiName", apiName);
128+
// All but first message in an API call are considered internal and will be hidden from the inspector.
129+
apiName = null;
130+
if (stackTraceCollector != null) {
131+
metadata.add("stack", stackTraceCollector.currentStackTrace());
132+
}
129133
}
130134
message.add("metadata", metadata);
131135
transport.send(message);

0 commit comments

Comments
 (0)