Closed amine-aboufirass closed 1 year ago
I also notice that img src
ing local files does not render the image. If I open index.html
outside of live-server
the image shows up just fine.
You don't – the live-server page has a "http" origin (even if it's a local address), and it would be a security vulnerability if a random HTTP origin page could access C:\Users\aa\Desktop
.
@akx Yes, after some reading I realized that this was by design, and done for security purposes.
My use case however involves live-refreshing a page so that I can see the changes on my browser as I work on the HTML. The HTML does contain images and local links.
Is there perhaps a workaround to get something like this to work with Live Server?
@akx (or someone else) how can we include images in the html document and still have it render in live-server?
@amine-aboufirass Just put those images in the same folder that's being served by live-server
and refer to them with their names only.
@akx I see, I was invoking live-server
with live-server test.html
. In fact I should be invoking it with live-server .
for the image to work.
Issue description
I'm trying to
a href
to a local folder. Typically I would do something like this:<a href="C:\Users\aa\Desktop ....>
. If I just openindex.html
with chrome, I'm able to navigate to the link and view the contents of the folder. However if I navigate to mylive-server
instance the link does not work. How can I get live-server to allow local folders/files?Software details
live-server
:live-server index.html
live-server
version: 1.2.2