在浏览器中测试PhoneGap + AJAX应用 [英] Testing PhoneGap+AJAX apps in browser
问题描述
我一直使用Cordova / PhoneGap一段时间,直到现在,我使用Chrome在浏览器中测试应用程序。
I have been using Cordova/PhoneGap for some time and until now, I used Chrome to try out the application in a browser.
应用程序有很多AJAX请求到不同的服务器,所以我使用Chrome的--disable-web-security参数来允许这些。但是,这个参数似乎不再工作了:新版本的Chrome抱怨这个参数是不允许的。我在Chromium上试过这个,我也得到相同的错误消息。此外,我已经尝试将Firefox的security.fileuri.strict_origin_policy设置为false,看看我是否可以在那里工作,没有效果。
The app had lots of AJAX petitions to a different server, so I used Chrome's --disable-web-security argument to allow for these. However, this argument seems not to work any longer: new versions of Chrome complain that this argument is not allowed. I've tried this on Chromium and I get the same error message either. Furthermore, I have tried setting Firefox's security.fileuri.strict_origin_policy to false to see if I could get it to work there, to no avail.
你知道如何测试这样的应用程序在现代浏览器?
Do you know how to test such an app in a modern browser? If not, is there a way to fall back to a previous version of Chrome?
推荐答案
您可以使用此插件。您可以点击一下激活/停用CORS:)
You can use this plugin. You can activate/deactivate CORS with one click :)
这篇关于在浏览器中测试PhoneGap + AJAX应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!