【发布时间】:2023-02-04 17:40:48
【问题描述】:
有这个网站我需要用用户登录并每次都通过。我一直在使用下面的代码将代码注入网站的文本框。 (登录后还有更多文本框需要自动填写)
wv.loadUrl("javascript:document.getElementById('SSUser_Logon_0-item-USERNAME').focus();");
wv.evaluateJavascript("try{document.activeElement.value='"+User+"';}catch(e){}",null);
我现在收到错误
Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
和
<uses-permission android:name="android.permission.INJECT_EVENTS" />
抛出这个permission is only granted to system apps 的错误。
我需要帮助来注入代码,或者找到另一种替代方法来自动填写网站上的文本框。
【问题讨论】: