Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #41003

Re: Cross-Origin Request Blocked

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: Cross-Origin Request Blocked
Date 2022-07-21 11:18 +0200
Message-ID <jjsk02Fa8nrU1@mid.individual.net> (permalink)
References <tb78ob$1p5e$1@gioia.aioe.org> <jjotcmFmpdlU1@mid.individual.net> <tb8oac$1j4ed$1@dont-email.me>

Show all headers | View raw


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:

<https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener>

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

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Cross-Origin Request Blocked emf <emfril@gmail.com> - 2022-07-19 17:46 -0400
  Re: Cross-Origin Request Blocked Arno Welzel <usenet@arnowelzel.de> - 2022-07-20 01:34 +0200
    Re: Cross-Origin Request Blocked The Natural Philosopher <tnp@invalid.invalid> - 2022-07-20 12:18 +0100
      Re: Cross-Origin Request Blocked Arno Welzel <usenet@arnowelzel.de> - 2022-07-21 11:18 +0200
        Re: Cross-Origin Request Blocked The Natural Philosopher <tnp@invalid.invalid> - 2022-07-21 11:24 +0100
  Re: Cross-Origin Request Blocked Ezimene nimi Teine nimi <techfan55555@hotmail.com> - 2023-03-06 03:27 -0800

csiph-web