我想window.location.href
在工具codeandbox.io中使用。这是因为我想在发生硬页面加载的情况下进行测试。但是,我遇到了一个问题。
location.href = "http://www.google.com"
我收到此错误:
Mixed Content: The page at 'https://codesandbox.io/s/lingering-bird-nyvfi' was loaded over HTTPS, but requested an insecure resource 'http://www.google.com/'. This request has been blocked; the content must be served over HTTPS.
示例: https ://codesandbox.io/s/locationhref-usage-nyvfi (查看src/index.ts
并打开开发控制台)
如何在假的虚拟浏览器中实现模拟页面加载的能力?