Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何绕过混合内容错误(http/https)_Javascript_Angularjs_Protractor_Automated Tests_Cucumberjs - Fatal编程技术网

Javascript 如何绕过混合内容错误(http/https)

Javascript 如何绕过混合内容错误(http/https),javascript,angularjs,protractor,automated-tests,cucumberjs,Javascript,Angularjs,Protractor,Automated Tests,Cucumberjs,当我试图批准网页中的文档时,出现以下错误 Mixed Content: The page at \'https://example.com\' was loaded over HTTPS, but requested an insecure resource \'http://insecure-page.com:9870/xyz\'. This request has been blocked; the content must be served over HTTPS.' 这是因为我的测试试

当我试图批准网页中的文档时,出现以下错误

Mixed Content: The page at \'https://example.com\' was loaded over HTTPS, but requested an insecure resource \'http://insecure-page.com:9870/xyz\'. This request has been blocked; the content must be served over HTTPS.'

这是因为我的测试试图在安全页面上加载非安全页面。有人能帮我绕过这个错误,这样我就可以继续自动化测试脚本中的其余步骤了。我正在使用javascript框架

我遇到了同样的问题,我尝试了这种方法

<iframe [src]="your-https-original-domain?URL=your-http-url" width="100%" height="600"></iframe>

希望这会有所帮助


请参阅:

上述解决方案不起作用我尝试了以下
chrome\u single:{browserName:'chrome',acceptsecurecerts:true,chromeOptions:{args:['window size=160001024','disable infobar','allow running unsecure content','allow unsecure localhost']}
您需要更改为
https
并使用自签名证书,然后linkI的解决方案无法更改它,因为它是来自另一个集成系统的链接