Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to get this to monitor local source files instead of ones at a URL? #33

Open
rubinj30 opened this issue Sep 16, 2022 · 2 comments

Comments

@rubinj30
Copy link

rubinj30 commented Sep 16, 2022

Hello! I was trying to set this up to monitor my files being changed within a specific directory on my local machine, but the Sources input field is requiring a URL.

Is there a way around this validation and if so, will it work with the local files?

@f1rf1n
Copy link

f1rf1n commented Dec 30, 2022

It is not possible for a web extension to read file from your local computer. This is an important safety measure built into browsers. I think this info should be in the readme, but on the official firefox live-reload addon page this is mentioned:

Due to security restrictions in web extensions, files served using the file system (file://...) cannot be monitored. A quick and easy workaround is to serve local files over http using Python, NodeJS or PHP.

These links point to relatively easy ways to 'serve' files from your local machine. I usually like using a virtual server setup to mimic the software and settings of the server where the live site will be hosted. My favorite solution for this is Lando which is an open source solution to make using docker much easier.

In any case when you have set up a way to serve the files to your browser, you can simple point it to something like http://localhost:8080/your.html or https://myproject.lndo.site/ depending on which route you choose.

@adynamique
Copy link

i don't know if it's a recent update, but it's possible to give an extension the access to file urls (at least, in ms edge)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants