No internet connection for applications when they are loaded as a file

Post Reply
MyGameTV
Posts: 1
Joined: Thu Dec 25, 2025 12:51 am

No internet connection for applications when they are loaded as a file

Post by MyGameTV »

Today I wanted to integrate my Ambilight control system and created an application for this purpose, which I use to call an HTML file on the Raspberry Pi. Unfortunately, the file then has no internet connection. More precisely, I'm trying to make API requests, but these aren't reaching the server. The same thing happens when I try to load things from an external source. The Pi has an internet connection via LAN, which I also tested by directly opening the YouTube URL as an application.
Does anyone have any idea what could be causing this or how I can fix it?

Kind regards, Daniel
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: No internet connection for applications when they are loaded as a file

Post by hudiy »

Hello,
This behavior is caused by the Same-Origin Policy: https://developer.mozilla.org/en-US/doc ... gin_policy

To resolve this, you need to run your code via a local HTTP server instead of opening the file directly.
Post Reply