GithubHelp home page GithubHelp logo

kana112233 / vscode-browser-preview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from auchenberg/vscode-browser-preview

0.0 2.0 0.0 32.02 MB

A real browser preview inside your editor that you can debug.

License: MIT License

TypeScript 90.09% HTML 1.38% CSS 6.38% JavaScript 2.15%

vscode-browser-preview's Introduction


logo
Browser Preview for VS Code

A real browser preview inside your editor that you can debug.

Browser Preview for VS Code enables you to open a real browser preview inside your editor that you can debug. Browser Preview is powered by Chrome Headless, and works by starting a headless Chrome instance in a new process. This enables a secure way to render web content inside VS Code, and enables interesting features such as in-editor debugging and more!

Getting started

  1. Grab extension from marketplace
  2. Click the new "Browser Preview" button in the Side Bar to the left or run the command Browser View: Open Preview

Make sure you have Google Chrome installed on your computer.

Features

  • Browser preview inside VS Code (Powered by Chrome Headless).
  • Ability to have multiple previews open at the same time.
  • Debuggable. Launch urls and attach Debugger for Chrome to the browser view instance, and debug within VS Code.
  • Attach Chrome DevTools via chrome://inspect
  • Option to set the default startUrl via browser-preview.startUrl
  • Option to set the path to the chrome exectuable via browser-preview.chromeExecutable
  • Option to set the type of rendering via browser-preview.format with the support for jpeg (default one) and png formats

How to change the default start url / start page?

Go to your settings, search for "browser preview" and set browser-preview.startUrl to your desired url.

Launch and Debugging

You can enable in-editor debugging of Browser Preview by installing Debugger for Chrome, and configure VS Code's debugger to either attach or launch to the browser previews by using the following configuration:

{
    "version": "0.1.0",
    "configurations": [
        {
            "type": "browser-preview",
            "request": "attach",
            "name": "Browser Preview: Attach"
        },
        {
            "type": "browser-preview",
            "request": "launch",
            "name": "Browser Preview: Launch",
            "url": "http://localhost:3000"
        }
    ]
}

The debug configuration also supports these additional properties: webRoot, pathMapping, trace, sourceMapPathOverrides and urlFilter. See https://github.com/Microsoft/vscode-chrome-debug#other-optional-launch-config-fields for details on how to use.

Watch It

Watch an animated gif showing how to open the preview and debug a browser app.

Additional configuration

Browser Preview has the following settings:

"browser-preview.startUrl": // The default start url for new Browser Preview instances
"browser-preview.verbose": false // Enable verbose logging of messages sent between VS Code and Chrome instance
"browser-preview.chromeExecutable": // The full path to the executable, including the complete filename of the exectuable
"browser-preview.format": // Option to set the type of rendering with the support for `jpeg` (default one) and `png` formats

vscode-browser-preview's People

Contributors

auchenberg avatar lostintangent avatar arjunattam avatar arminkhodaei avatar johnpapa avatar warpdesign avatar jarrodldavis avatar mjurczyk avatar jawn avatar capaj avatar joseluisq avatar modul8com avatar peterblazejewicz avatar simonsiefke avatar lpmi-13 avatar

Watchers

James Cloos avatar  avatar

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.