为现有网站定制 Javascript
我想创建一个 Android 应用程序来查看现有的 Web URL,但是,我还希望 Android 应用程序上的按钮控件能够在网站的上下文中运行自定义 javascript 代码。
关于如何实现这一点有什么想法吗?也许扩展或创建一个自定义 WebView?有什么想法吗?
谢谢
I would like to create an android application which views an existing web URL, However, i would also like the button controls on the android app to be able to run custom javascript code on the website's context.
Any ideas on how to make this happen? Perhaps extend or create a custon WebView?? Any Ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在一般浏览器中,您可以通过 url bar 注入执行任意 javascript(如果保存在书签中,也称为 bookmarklet)。
您可以通过将其粘贴到桌面浏览器 URL 栏中
window.alert("hello")
来测试所有这些。In browsers in general you can execute arbitrary javascript via url bar injection (also called bookmarklet if saved in bookmarks).
You can test all this by pasting this in your desktop browser url bar
window.alert("hello")
.