Comments (6)
Currently, there is no setting for opening the preview on localhost. Are you using an endpoint that only allows access from the localhost domain name? And if so, are there no workarounds with this?
If you're hosting locally, there are options in livePreview.httpHeaders
to modify headers (and potentially the CORS headers) if that helps in your case for consumption.
from vscode-livepreview.
Currently, there is no setting for opening the preview on localhost.
Bummer. Well at least now I know not to look for something that isn't there!
Are you using an endpoint that only allows access from the localhost domain name? And if so, are there no workarounds with this?
It's not that the resource (FontAwesome in particular) only allows access from localhost, but that it only allows access any domain specified. Attempting to specify an IP address doesn't work. Since there's no direct reference (that I can find) to that restriction in their docs, I'm attaching a screen shot. I'm not aware of any workarounds.
If you're hosting locally, there are options in
livePreview.httpHeaders
to modify headers (and potentially the CORS headers) if that helps in your case for consumption.
Thanks - I'll try that to see if I can get it to work.
from vscode-livepreview.
If you're hosting locally, there are options in
livePreview.httpHeaders
to modify headers (and potentially the CORS headers) if that helps in your case for consumption.
Wait, my understanding is that these options, as you have in the help for the settings, modify "The extra HTTP headers that should be set in the server's HTTP responses." So these headers impact what the browser sees when requesting resources from the local host, ie http://127.0.0.1:3000.
What I need to manipulate is what Referer
is specified when the browser then requests an outside resource (ie. AJAX or script source). In other words, Request Headers, not Response Headers. I'm attaching another screen grab from Firefox's console.
If the extension merely allowed launch on localhost in addition to the specific IP, I wouldn't need to manipulate those headers, they would just be there. I've been using Live Server instead as a result of this requirement.
Totally understand if you don't want to match that requirement! As I mentioned above, more importantly I wanted to make sure I wasn't spending time looking for an option that didn't exist.
from vscode-livepreview.
I can make this a feature for the backlog to support localhost for launching, but I cannot guarantee that I can get to it soon. I can see the setting enabling launching localhost if livePreview.hostIP
is set to 127.0.0.1
from vscode-livepreview.
Oh, no need for guarantees from me! :-) I appreciate just seeing it added to the backlog - thank you so much for that, and for all you've done to make this great extension!
from vscode-livepreview.
I stumbled on this issue while working with Live Preview and am running an integration with a 3rd party payment provider sandbox that allows http to be used only with localhost. It does not recognize the loopback address as localhost.
I've been working around this, but being able to have it launch using localhost would be an awesome feature for this extension.
Not trying to expedite, just trying to add further justification to why this functionality would be needed.
Thank you for helping to make VS Code even better.
from vscode-livepreview.
Related Issues (20)
- live preview not showing up while using Github Repositories extension HOT 1
- just white,cannot work normal HOT 8
- preview HOT 3
- Click on tags/elements in HTML and jump to it in HTML document HOT 2
- live server HOT 1
- PHP support HOT 1
- It becomes Dark!!! HOT 1
- xaml后续能支持吗 HOT 1
- An unknown error occurred. Please consult the log for more details. HOT 2
- Not working HOT 11
- Problem with "charset=ISO-8859-1" HOT 6
- Add a "Start Preview" button HOT 2
- Live preview zoomed out
- Not working HOT 2
- FR: It would be nice to sync the preview with the code HOT 1
- show preview not working HOT 6
- Live refresh not working in secure environments HOT 1
- auto refresh not working and url not showing HOT 1
- Option blocked when DevTools docked to right side HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-livepreview.