Document hooking into the Network panel of DevTools (for plugins)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- devtools, javascript, typescript
- Ambito
- developer-experience, documentation, networking
Direzione di ricerca
Inizia individuando la documentazione attuale di Debugging e le interfacce attuali di debugger.ts a cui fa riferimento il vecchio contenuto. Esamina i callback del pannello Network e sostituisci i link e gli esempi obsoleti con le indicazioni più recenti sull’API principale. Il lavoro è completato quando una guida autonoma per gli autori di plugin spiega accuratamente il ciclo di vita attuale delle richieste e delle risposte.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
There are global APIs to list Netowork requests in the DevTools Network panel, we should document these in a guide for plugin authors. This used to be part of the "Debugging" docs, however it doesn't quite fit there.
The content itself needs to be reviewed and updated to reflect latest core (the API is mostly unchanged, but the docs contain old links).
Old content for reference
Network requests in plugins - Note: The following content concerns only plugin authors who wrap and expose Android (Network agent in DevTools not yet supported with a public API in the iOS runtime) http functionalities. To make your http functionality debuggable, there are callbacks you need to call at certain times of the lifecycle of the network request, following a specific protocol. For your convenience, we've exposed callbacks and TypeScript interfaces to facilitate sending information to the Network agent.
- Immediately before making the request:
Check if theglobal.__inspectorobject is available, and whether the DevTools are connected:
if (global.__inspector && global.__inspector.isConnected) {
}
Build a RequestData-compliant object, as declared in the debugger module. RequestData contains the minimum subset of properties needed to display request entries in the Network panel. Finally call to the runtime-exposed callback:
global.__inspector.requestWillBeSent(requestData)
-
When a response is received:
Check if the
global.__inspectorobject is available, and whether the DevTools are connected, as shown above. Build a ResponseData-compliant object, as declared in the debugger module.ResponseDatacontains the minimum subset of properties needed to display the response for a completed request.Build a LoadingFinishedData compliant object, as declared in the debugger module. The object notifies the Network agent that a request has completed, as well as the time spent.
Build a SuccessfulRequestData-compliant object, as declared in the debugger module. The object contains the response data, in a string format, the Id of the original request the response data corresponds to, and information whether the content should be base64-encoded, or not.
Finally call the following runtime-exposed callbacks:
global.__inspector.responseReceived(responseData) global.__inspector.loadingFinished({ requestId: requestIdStr, timestamp: getTimeStamp(), }) global.__inspector.dataForRequestId(successfulRequestData)
- Lingua principale
- JavaScript
- Stelle
- 17
- Fork
- 31
- Merge medio
- 8h 51m
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NativeScript/docs
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
NativeScript/docs#177 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
NativeScript/docs#189 ·
-
Label: maxLines Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 48/100
NativeScript/docs#182 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
NativeScript/docs#178 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
NativeScript/docs#159 ·
Tutte le issue di NativeScript/docs
Issue simili
-
Edit: CW+ Apertachannels:edit check:passed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
idean3885/claude-ops-agent#521 ·
-
[Nytt ikon]: menu-search Apertaforespørsel 🥰 ikoner 🖼 nytt ✨
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100