дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-28 05:22:23 +02:00
A page session gets a Network tab in the Debug tool window: the page's requests with status, method, type, size and time, filtered by URL, resource kind and My code only (a request sent through a library is attributed to the project code that called it). A request shows its headers, response body (text, cut at 1 MB) and initiator; Break on Next Request turns it into a request breakpoint, and Reload Page loads the page again. js-debug's enableNetworking is asked once the page's launch is answered; a js-debug that doesn't report requests says so in the tab. Co-authored-by: ntbang0901 <[email protected]>
14 рядки
510 B
TypeScript
14 рядки
510 B
TypeScript
import { useDebug } from "../state";
|
|
import { forgetNetwork, useJsNetwork } from "./network";
|
|
|
|
/**
|
|
* Drops a session's requests when the session is removed. (Recording itself starts in the
|
|
* backend with the page session, so that the page's load is in the list.) Returns the
|
|
* unsubscribe function.
|
|
*/
|
|
export function watchNetworkSessions(): () => void {
|
|
return useDebug.subscribe((s) => {
|
|
for (const id of Object.keys(useJsNetwork.getState().rows)) if (!s.sessions[+id]) forgetNetwork(+id);
|
|
});
|
|
}
|