我收到了一个错误
XMLHttpRequest无法加载https://my-api.domain.com.原始文件:// Access-Control-Allow-Origin不允许.
当我尝试运行一些异步单元测试时,通过grunt-contrib-jasmine查询API,而后者又使用PhantomJS.我看到PhantomJS的命令行版本确实有"web-security"选项.我可以控制grunt-contrib-jasmine如何使用PhantomJS来包含此选项并禁用跨域安全性吗?
jso*_*son 15
您可以将选项传递给phantomjs,就像在命令行上一样,例如
以下选项可能会有所帮助,但可以在phantomjs文档中找到更多选项
jasmine : {
  your_task : {
    options : {
      '--web-security' : false,
      '--local-to-remote-url-access' : true,
      '--ignore-ssl-errors' : true
    }
  }
}
| 归档时间: | 
 | 
| 查看次数: | 1703 次 | 
| 最近记录: |