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


Groups > comp.lang.javascript > #41000 > unrolled thread

Cross-Origin Request Blocked

Started byemf <emfril@gmail.com>
First post2022-07-19 17:46 -0400
Last post2023-03-06 03:27 -0800
Articles 6 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  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

#41000 — Cross-Origin Request Blocked

Fromemf <emfril@gmail.com>
Date2022-07-19 17:46 -0400
SubjectCross-Origin Request Blocked
Message-ID<tb78ob$1p5e$1@gioia.aioe.org>
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?

Thanks,

Eustace
-- 
It ain't THAT, babe! — A radical reinterpretation
https://emf.neocities.org/bd/itaintmebabe.html

[toc] | [next] | [standalone]


#41001

FromArno Welzel <usenet@arnowelzel.de>
Date2022-07-20 01:34 +0200
Message-ID<jjotcmFmpdlU1@mid.individual.net>
In reply to#41000
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.

Accessing local files is restricted for security reasons.

Also see:
<https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp>

-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [next] | [standalone]


#41002

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2022-07-20 12:18 +0100
Message-ID<tb8oac$1j4ed$1@dont-email.me>
In reply to#41001
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.

Or find some mechanism where JavaScript or the browser interacts with 
the host, and subvert it...



> Accessing local files is restricted for security reasons.
> 
> Also see:
> <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp>
> 


-- 
Ideas are more powerful than guns. We would not let our enemies have 
guns, why should we let them have ideas?

Josef Stalin

[toc] | [prev] | [next] | [standalone]


#41003

FromArno Welzel <usenet@arnowelzel.de>
Date2022-07-21 11:18 +0200
Message-ID<jjsk02Fa8nrU1@mid.individual.net>
In reply to#41002
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

[toc] | [prev] | [next] | [standalone]


#41004

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2022-07-21 11:24 +0100
Message-ID<tbb9hl$2a46u$3@dont-email.me>
In reply to#41003
On 21/07/2022 10:18, Arno Welzel wrote:
> 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.
> 
> 
Well yes, semantics is one thing, bits in silicon is another.

-- 
A lie can travel halfway around the world while the truth is putting on 
its shoes.

[toc] | [prev] | [next] | [standalone]


#41226

FromEzimene nimi Teine nimi <techfan55555@hotmail.com>
Date2023-03-06 03:27 -0800
Message-ID<0d070abe-0a22-4041-8c17-1f3294ecfa4bn@googlegroups.com>
In reply to#41000
Get to: http://aaaaaaaaaaaaaaaar.medianewsonline.com/firstpage.php

And invite all Your friends too !!!!!!!!!!!





On Tuesday, July 19, 2022 at 11:47:00 PM UTC+2, emf wrote:
> 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? 
> 
> Thanks, 
> 
> Eustace 
> -- 
> It ain't THAT, babe! — A radical reinterpretation 
> https://emf.neocities.org/bd/itaintmebabe.html

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web