Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-domain error with Chrome in local dev only. How to resolve?

I'm getting the cross-domain error on my local machine (although the code works perfectly on our web server). This is a real pain in the butt for development, so what I'm wondering is this - can I adjust a setting in Chrome to not get that error locally anymore?

It's this one:

Unsafe JavaScript attempt to access frame with URL file:///Users/david/login.html from frame with URL file:///Users/david/varReturn.html. Domains, protocols and ports must match.

Thanks!

like image 546
maskedbacon Avatar asked Jan 16 '23 12:01

maskedbacon


1 Answers

Google has decided that offline file access is cross-domain, regardless. You can try running chrome with --allow-file-access-from-files. I encountered the same problem when reading text files from the same folder using JavaScript.

like image 58
Rhyono Avatar answered Jan 23 '23 15:01

Rhyono