Solved

Bypass cross origin issues on development site

Posted on 2016-11-30
3
65 Views
Last Modified: 2016-11-30
I am testing my website locally on a Mac in Firefox.

I have a Microsoft IIS server where ASP scripts are located.

My local Javascript file references a script like this:

$.get('http://www.domain.com/_script.asp', {email:email}, function(result){...

Open in new window


Of course, when I test my local website, I get Cross-Origin Request Blocked errors in Firefox. It isn't clear to me if these errors are coming from Firefox (local computer) or from the server. Or both?

At least for testing purposes, is it possible for me to bypass these errors? I don't want to permanently undo any security settings. After the website goes live I would want it as it is now. But for testing, it would be really convenient if I could access those scripts from my local development site.

Thank you.
0
Comment
Question by:bbdesign
3 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 250 total points
ID: 41907643
taken from here

Chrome has a wonderful command line argument to disable web security.  To start Chrome with web security disabled, run the following command:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security
0
 
LVL 14

Assisted Solution

by:Juan Ocasio
Juan Ocasio earned 250 total points
ID: 41907647
Try adding the following to web.config:
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>
0
 

Author Comment

by:bbdesign
ID: 41907728
web.config isn't an option for me, unfortunately, because I am on IIS 6.

I found a Firefox add-on called "cors everywhere" which seems to do the trick. Similar to the Google Chrome suggestion. I didn't realize the setting was in the browser and could be controlled in that way.

Thanks for the input!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now