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

I get a cross-domain error on my local machine (although the code works fine on our web server). This is a real pain in the stock for development, so I wonder if I can adjust the setting in Chrome so as not to get this error locally?

This one is:

Insecure JavaScript is trying to access the frame with the file URL: ///Users/david/login.html from the frame with the URL file: ///Users/david/varReturn.html. Domains, protocols, and ports must be consistent.

Thanks!

+4
source share
1 answer

Google decided that offline file access is cross-domain, independently. 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.

+8
source

Source: https://habr.com/ru/post/1435411/


All Articles