{"id":17091201,"url":"https://github.com/youngsoft/ysremoteinspector","last_synced_at":"2025-04-12T22:34:50.156Z","repository":{"id":62775774,"uuid":"562353183","full_name":"youngsoft/YSRemoteInspector","owner":"youngsoft","description":"an iOS JSContext/WebView remote inspector","archived":false,"fork":false,"pushed_at":"2023-04-23T01:31:14.000Z","size":36,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T21:50:31.704Z","etag":null,"topics":["cdp","chrome-devtools","inspector","ios","jscontext","safari","webview","wip"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youngsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-06T04:13:43.000Z","updated_at":"2024-05-07T11:46:06.000Z","dependencies_parsed_at":"2022-11-06T08:45:28.961Z","dependency_job_id":null,"html_url":"https://github.com/youngsoft/YSRemoteInspector","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngsoft%2FYSRemoteInspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngsoft%2FYSRemoteInspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngsoft%2FYSRemoteInspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngsoft%2FYSRemoteInspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youngsoft","download_url":"https://codeload.github.com/youngsoft/YSRemoteInspector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642308,"owners_count":21138350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdp","chrome-devtools","inspector","ios","jscontext","safari","webview","wip"],"created_at":"2024-10-14T13:58:00.820Z","updated_at":"2025-04-12T22:34:50.136Z","avatar_url":"https://github.com/youngsoft.png","language":"C++","readme":"# YSRemoteInspector\n\n[![CI Status](https://img.shields.io/travis/oubaiquan/YSRemoteInspector.svg?style=flat)](https://travis-ci.org/oubaiquan/YSRemoteInspector)\n[![Version](https://img.shields.io/cocoapods/v/YSRemoteInspector.svg?style=flat)](https://cocoapods.org/pods/YSRemoteInspector)\n[![License](https://img.shields.io/cocoapods/l/YSRemoteInspector.svg?style=flat)](https://cocoapods.org/pods/YSRemoteInspector)\n[![Platform](https://img.shields.io/cocoapods/p/YSRemoteInspector.svg?style=flat)](https://cocoapods.org/pods/YSRemoteInspector)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n在调试iOS上的JSContext和WebView时，我们只能通过Safari中的“开发”菜单进行。 这个开源库的目的就是用来打破这些限制，我们可以不依赖于Safari，甚至是通过无线网络的方式来实现调试工作。\n对于JSContext和WebView来说，系统内部实现了一个可调试对象(Debuggable)。Debuggable对象实现了一个RemoteControllableTarget接口。我们可以通过这个接口使用WIP协议来获取内部的调试数据。iOS的WebKit并未公开这些能力。\n\n\n对于YSRemoteInspector来说，它实现了两个功能。一个是用来调试JSContext和WebKit。一个是用来监视Safari和本应用进行通信的所有WIP协议数据。\n\n对于第一个功能来说，为了调试JSContext和WebView。你需要创建一个YSRemoteInspector对象，这个是一个远程检查器对象。你需要用JSContext或者WebView来初始化它，然后调用connect方法连接上调试目标，最后通过dispatchMessage方法来进行通信。通信数据是一个NSDictionary格式的数据。这个字典由三部分组成：\n```\nid: 一个自增的数字唯一标识。\nmethod:  一个字符串表示的方法，它由”Domain.Command”组成，用来指定要获取的信息方法 \nparams:   用来指定method所附带的参数。\n```\ndispatchMessage方法会返回method调用指定的信息，格式也是一个NSDictionary。\n\n当然具体的消息格式以及内容规约你可以参考：[https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore/inspector/protocol](https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore/inspector/protocol) 中的内容。\n\n\n对于第二个功能来说。你可以通过调用类方法enableProtocolMonitor来开启消息的监听，当开启消息监听后，所有通过Safari来进行调试的通信数据都可以被监控到。你可以通过这些监控数据来分析和查看Safari是如何对JSContext/WebView进行调试的。\n\n\n那么YSRemoteInspector到底有什么用呢？\n\n我想应该有两个用处：\n  1.你可以不依赖Safari来实现JSContext/WebView 对象的调试。\n   2.你可以通过其他调试工具，比如google的CDT工具来实现对JSContext/WebKit的调试。\n\n## Requirements\n\n## Installation\n\nYSRemoteInspector is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'YSRemoteInspector'\n```\n\n## Author\n\nyoungsoft, obq0387_cn@sina.com\n\n## License\n\nYSRemoteInspector is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungsoft%2Fysremoteinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoungsoft%2Fysremoteinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungsoft%2Fysremoteinspector/lists"}