Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每次我在浏览器中访问新网站时,我都想将访问的 URL 传递给将在后台运行的 Java 函数。解决此问题的最佳方法是什么?
使用Fiddler(仅限 Windows)。您可以订阅 HTTP 请求等事件,并以适当的方式响应 - 在您的示例中调用 Java 函数。
如果您只想响应您使用浏览器访问的网站,您可以检查用户代理 HTTP 标头。