grunt-contrib-jasmine and PhantomJS security

前端 未结 1 1171
小蘑菇
小蘑菇 2020-12-31 22:12

I\'m getting an error

XMLHttpRequest cannot load https://my-api.domain.com. Origin file:// is not allowed by Access-Control-Allow-Origin.

when I try to run s

相关标签:
1条回答
  • 2020-12-31 22:28

    You can pass options to phantomjs similarly to how you would on the command line, e.g.

    The following options may help, but more can be found at the phantomjs docs

    jasmine : {
      your_task : {
        options : {
          '--web-security' : false,
          '--local-to-remote-url-access' : true,
          '--ignore-ssl-errors' : true
        }
      }
    }
    
    0 讨论(0)
提交回复
热议问题