Document hooking into the Network panel of DevTools (for plugins)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- devtools, javascript, typescript
Línea de trabajo
Comienza localizando la documentación actual de Debugging y las interfaces actuales de debugger.ts a las que se hace referencia en el contenido antiguo. Revisa los callbacks del panel Network y sustituye los enlaces y ejemplos obsoletos por las indicaciones más recientes de la API principal. Se considera terminado cuando exista una guía independiente para autores de plugins que explique correctamente el ciclo de vida actual de las solicitudes y las respuestas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- JavaScript
- Estrellas
- 17
- Forks
- 31
- Merge medio
- 8 h 51 min
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NativeScript/docs
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
NativeScript/docs#177 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
NativeScript/docs#189 ·
-
Label: maxLines Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 48/100
NativeScript/docs#182 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
NativeScript/docs#178 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
NativeScript/docs#159 ·
Todos los issues de NativeScript/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Seeed-Studio/wiki-documents#5655 · 2 comentarios ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
capricorn86/happy-dom#2435 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Edit: CW+ Abiertochannels:edit check:passed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
01 type: bug 30 needs: triage 99 tag: UX Accessibility
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100