开发者

Allowing Cross domain ajax calls from firefox

开发者 https://www.devze.com 2023-01-22 23:18 出处:网络
I want to change the settings of firefox so as to allow it to make cross domain ajax calls. Since due to the security feature of the firefox it doen\'t allow ajax calls to be made. I know if it is in

I want to change the settings of firefox so as to allow it to make cross domain ajax calls. Since due to the security feature of the firefox it doen't allow ajax calls to be made. I know if it is in same domain it will allow. I have a code given bellow which in safari works fine but firefox doesn't display the results when it calls csce server then since the code is on local machine doesn't allow it and returns error. I know it will start working if I load m开发者_StackOverflow中文版y this code to csce server but I want to run the code from my machine. So can anyone help me in resolving this. I have spent past couple of days just searching for this solution.

Kindly suggest how to achieve this or should I go with some older version of firefox?

I googled and set the parameters of browser in config file as specified in this site but it still doesn't work.

http://code.google.com/p/httpfox/issues/detail?id=20


Maybe you could use privoxy and tell it to inject something like "Access-Control-Allow-Origin: *" in the server response. To do this, you would have to go into the file user.filter (create it if it doesn't exist) in privoxys configuration directory and insert something like this:

SERVER-HEADER-FILTER: allow-crossdomain
s|Server: .*|Access-Control-Allow-Origin: *|

Instead of Server, you can also use any other header that's always present and you don't need. And this into user.action:

{+server-header-filter{allow-crossdomain}}
csce.unl.edu

Note: I didn't test it.

https://developer.mozilla.org/En/HTTP_access_control

http://config.privoxy.org/user-manual/


This appears to enable XSS from file:// pages in Firefox 4, although it prompts you so might not be suitable for more than simple test pages:

netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号