Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Cross-Origin Request Blocked Date: Thu, 21 Jul 2022 11:18:58 +0200 Lines: 36 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net dtpp2B0b0FB8YLfpeKhIhwGQEIQy0g8WijLYjiTIod0hhtFLC9 Cancel-Lock: sha1:rhAj+IafIYJ2YSATCgNEFxEs1lc= Content-Language: de-DE In-Reply-To: Xref: csiph.com comp.lang.javascript:41003 The Natural Philosopher: > On 20/07/2022 00:34, Arno Welzel wrote: >> emf: >> >>> Hi. >>> >>> I have on my computer a program that reads a local text file. It >>> used to work OK but now it doesn't and the Web Developer Tools >>> of Firefox says: >>> >>> Cross-Origin Request Blocked: The Same Origin Policy disallows >>> reading the remote resource at file:///C:/... >>> >>> Is there any work-around? >> >> No. >> > I wouldn't be as categorically sure as all that. > I can think of at least one way. > > Construct a minimal web server on the local machine and access it via ajax. For this you need Node.js: Or setup Apache2 or Nginx. I'm not sure if I'd call this a "workaround". To me this seems to be a completely different approach - don't access locally but using a webserver. -- Arno Welzel https://arnowelzel.de