Document hooking into the Network panel of DevTools (for plugins)
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- devtools, javascript, typescript
研究方向
首先定位目前的 Debugging 文件,以及舊內容中參照的目前 debugger.ts 介面。檢視 Network 面板的 callback,並以最新的核心 API 指南取代過時的連結和範例。當一份面向 plugin 作者的獨立指南能準確說明目前的 request 與 response 生命週期時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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)
- 主要語言
- JavaScript
- 星號
- 17
- 分支
- 31
- 平均合併
- 8 小時 51 分鐘
- 30 天內合併 PR
- 2
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NativeScript/docs 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 68/100
NativeScript/docs#177 ·
-
難度 3/5 1-2 天 新手友好度 38/100
NativeScript/docs#189 ·
-
Label: maxLines 未關閉
難度 1/5 1 小時以內 新手友好度 48/100
NativeScript/docs#182 ·
-
難度 3/5 1-2 天 新手友好度 45/100
NativeScript/docs#178 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 35/100
NativeScript/docs#159 ·
查看 NativeScript/docs 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
avniproject/avni-client#2135 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
難度 2/5 1-3 小時 新手友好度 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
難度 1/5 1 小時以內 新手友好度 90/100
matrix-org/matrix.org#3649 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
vadimdemedes/ink#1029 ·