我正在使用 Application Insights JS SDK React Plugin将应用程序见解数据记录到 Azure。此数据发布可能会被某些浏览器扩展程序(例如 Ad Blocker、Privacy Badger 等)阻止。在我的案例中,分析在实验时被 Privacy Badger 阻止。
我知道可以通过从浏览器禁用特定站点的相关加载项来防止这种情况。只是想知道是否有一种特殊的方法可以从实现方面防止这种情况发生,而不要求用户禁用他们的附加组件。
最佳答案
您是否考虑过构建一个代理来将流量转发到您自己的域,然后再将其传递到 App Insights?
https://github.com/shaneochotny/ApplicationInsights-JS-Proxy
Show how to proxy requests from the Application Insights Javascript SDK instead of sending telemetry directly to dc.services.visualstudio.com. This allows you to do things such as use your own custom domain and/or hide the Instrumentation Key.
该链接中提供了配置此功能的分步说明
关于reactjs - 如何绕过浏览器加载项阻止 Azure Application Insight 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67735334/