android - Flutter InAppWebView 如何禁用跨域策略?
问题描述
我正在使用 InAppWebView 通过监听 onLoadResource 来制作视频下载应用程序,并抓取用户播放的视频并在 iframe 中播放视频,并且由于跨源策略,我无法获取 iframe 中的 url (.mp4, .m3u8......),我确实将allowUniversalAccessFromFileURLs和allowFileAccessFromFileURLs设置为true,但没有结果我无法获得iframe调用的资源:/,这是我的初始选项:
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
supportMultipleWindows: true,
offscreenPreRaster: true,
allowUniversalAccessFromFileURLs: true,
allowFileAccessFromFileURLs: true,
),
crossPlatform: InAppWebViewOptions(
useOnLoadResource: true,
debuggingEnabled: true,
userAgent:
"Mozilla/5.0 (Linux; Android 9; Redmi Note 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Mobile Safari/537.36",
javaScriptEnabled: true,
javaScriptCanOpenWindowsAutomatically: true,
)),
如果非常熟悉 inappwebview 或颤振的人会告诉我如何在颤振中禁用跨源策略或如何在不使用代理的情况下收听我的应用程序 http 请求...,我将不胜感激
解决方案
推荐阅读
- javascript - 如何禁用在 v-time-picker 小部件中选择分钟?
- python - 如何在 Windows 10 的 python 中安装模块 pybluez
- android - 我怎样才能在drawable中绘制这个形状
- sql-server - 多值参数在 Oracle 数据源的 SSRS 2017 中不起作用
- react-native - React Native Stack 维护的 React 导航
- adobe - AEM 调度程序需要在部署后自动启动
- java - 如何单击 selenium webdriver 中的剑道下拉菜单
- javascript - 如何在 NodeJS 中转换为导入/导出 ES 模块
- c++ - 不同 C++ 文件中未命名命名空间中的名称可以引用相同的命名事物吗?
- html - 使用 xpath 时找不到元素