Git Product home page Git Product logo

Comments (6)

andreamah avatar andreamah commented on June 16, 2024

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.

mmdolbow avatar mmdolbow commented on June 16, 2024

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.
font-awesome-error-ip

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.

mmdolbow avatar mmdolbow commented on June 16, 2024

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.
font-awesome-request-headers

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.

andreamah avatar andreamah commented on June 16, 2024

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.

mmdolbow avatar mmdolbow commented on June 16, 2024

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.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.