Visual Studio, Ripple Emulator and CORS/Cross Domain Ajax

前端 未结 3 1849
时光取名叫无心
时光取名叫无心 2020-12-11 18:34

I have an issue with Visual Studio when working on a multi device hybrid app. When I try do to an ajax call to an external webservice, and get some errors in ripple. (Cross

3条回答
  •  孤街浪徒
    2020-12-11 18:52

    I got this problem sorted by downloading and installing a chrome extension, that sets the web security setting 'on' and 'off'.

    Link for the extension: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?utm_source=chrome-app-launcher-info-dialog

    • Visual studio seems to run a separate/second copy of Chrome.
    • You have to install the extension in the Chrome instance that VS opens when it runs Ripple. If you install the extension in your normal Chrome browser, it is not available in the instance that VS uses.
    • I then had to set my ripple proxy setting to disabled.
    • The call also fails if I just debug in ripple, with the CORS setting already on. I have to physically flip the switch, off, and then on again, every time I debug in ripple, otherwise I get the cross domain issues.

    All is good now, life can go on.

提交回复
热议问题