• Cross-Origin Request Blocked

    From emf@21:1/5 to All on Tue Jul 19 17:46:50 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Wed Jul 20 01:34:48 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to Arno Welzel on Wed Jul 20 12:18:35 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Thu Jul 21 11:18:58 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to Arno Welzel on Thu Jul 21 11:24:52 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ezimene nimi Teine nimi@21:1/5 to emf on Mon Mar 6 03:27:16 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)