Git Product home page Git Product logo

vscode-open-in-browser's Introduction

vscode-open-in-browser

vscode 插件

  1. 在文件的右键菜单里里加入 open In Browser菜单
  2. 点击 open In Browser 会首先判断配置中的enableHost是否启用 如果没有启用则直接唤起浏览器打开本地文件 如:file:///xxx/xx.html 如果启用则会把 documentRoot 替换为http://host 后打开

配置

"qingyangmoke.openInBrowser.documentRoot": "/Users/song/Develop/",
"qingyangmoke.openInBrowser.enableHost": true,
"qingyangmoke.openInBrowser.host": "localhost",

比如本地文件路径是 /www/github/vscode-test/index.html

启用host的方式

1.修改配置

"qingyangmoke.openInBrowser.documentRoot": "/www/",
"qingyangmoke.openInBrowser.enableHost": true,
"qingyangmoke.openInBrowser.host": "localhost"

2.打开后的地址为:

http://localhost/github/vscode-test/index.html

未启用host方式

"qingyangmoke.openInBrowser.enableHost": false,

打开后的地址为:

file:///www/github/vscode-test/index.html

本地编译

1. 全局安装 vsce

  npm i vsce -g 

2. 安装依赖

  npm i

3. 编译
  npm run build

安装到vscode

vscode -> 扩展-> 从 vsix 安装 -> 选择上面编译好的文件

./dist/vscode-open-in-browser-x.x.x.vsix

vscode-open-in-browser's People

Contributors

qingyangmoke avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vscode-open-in-browser's Issues

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.