{"action":"created","issue":{"url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/23","repository_url":"https://api.github.com/repos/dequan1331/HybridPageKit","labels_url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/23/comments","events_url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/23/events","html_url":"https://github.com/dequan1331/HybridPageKit/issues/23","id":452291286,"node_id":"MDU6SXNzdWU0NTIyOTEyODY=","number":23,"title":"如何注入js","user":{"login":"wangweihu","id":12882847,"node_id":"MDQ6VXNlcjEyODgyODQ3","avatar_url":"https://avatars2.githubusercontent.com/u/12882847?v=4","gravatar_id":"","url":"https://api.github.com/users/wangweihu","html_url":"https://github.com/wangweihu","followers_url":"https://api.github.com/users/wangweihu/followers","following_url":"https://api.github.com/users/wangweihu/following{/other_user}","gists_url":"https://api.github.com/users/wangweihu/gists{/gist_id}","starred_url":"https://api.github.com/users/wangweihu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangweihu/subscriptions","organizations_url":"https://api.github.com/users/wangweihu/orgs","repos_url":"https://api.github.com/users/wangweihu/repos","events_url":"https://api.github.com/users/wangweihu/events{/privacy}","received_events_url":"https://api.github.com/users/wangweihu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-05T02:47:14Z","updated_at":"2019-06-08T03:20:21Z","closed_at":null,"author_association":"NONE","body":""},"comment":{"url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/comments/500089743","html_url":"https://github.com/dequan1331/HybridPageKit/issues/23#issuecomment-500089743","issue_url":"https://api.github.com/repos/dequan1331/HybridPageKit/issues/23","id":500089743,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMDA4OTc0Mw==","user":{"login":"dequan1331","id":5770443,"node_id":"MDQ6VXNlcjU3NzA0NDM=","avatar_url":"https://avatars0.githubusercontent.com/u/5770443?v=4","gravatar_id":"","url":"https://api.github.com/users/dequan1331","html_url":"https://github.com/dequan1331","followers_url":"https://api.github.com/users/dequan1331/followers","following_url":"https://api.github.com/users/dequan1331/following{/other_user}","gists_url":"https://api.github.com/users/dequan1331/gists{/gist_id}","starred_url":"https://api.github.com/users/dequan1331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dequan1331/subscriptions","organizations_url":"https://api.github.com/users/dequan1331/orgs","repos_url":"https://api.github.com/users/dequan1331/repos","events_url":"https://api.github.com/users/dequan1331/events{/privacy}","received_events_url":"https://api.github.com/users/dequan1331/received_events","type":"User","site_admin":false},"created_at":"2019-06-08T03:20:21Z","updated_at":"2019-06-08T03:20:21Z","author_association":"OWNER","body":"整体上来说，对于 WKWebView 系统提供了 addUserScript 这样的函数来让开发者在合适的时间注入 JS。当然也可以在任何时间执行 JS 函数来进行注入。\r\n如果使用HybridPageKit提供的可复用的WebView，建议在重写componentViewWillLeavePool函数中注入JS，同时在componentViewWillEnterPool中remove。\r\n如果是自定义的WebView，简单的在初始化的时候调用系统函数注入即可。"}}
{"actor":{"display_login":"dequan1331"}}