修改vs插件示例 本文共有1746个字,关键词: 插件网站:https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview 仓库:https://github.com/auchenberg/vscode-browser-preview.git 修改 ext-src/browser.ts ```bash //if (!chromePath) { // this.telemetry.sendEvent('error', { // type: 'chromeNotFound' // }); // throw new Error( // `No Chrome installation found, or no Chrome executable set in the settings - used path ${chromePath}` // ); // } ``` ```bash // const puppeteer = require('puppeteer-core'); // 删除 const puppeteer = require('puppeteer'); // 改为 ``` ```bash npm i vsce -g npm install react-scripts vsce package ``` 安装 puppeteer ```bash npm install -g cnpm --registry=https://registry.npm.taobao.org cnpm install puppeteer npm i bufferutil@^4.0.1 -g npm i encoding@^0.1.0 -g npm i utf-8-validate@^5.0.2 -g chrome /root/node_modules/_puppeteer@17.1.1@puppeteer/.local-chromium/linux-1036745 yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y yum install ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y ``` 安装 chrome ```bash wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm yum install ./google-chrome-stable_current_x86_64.rpm vim /usr/bin/google-chrome 将 exec -a "$0" "$HERE/chrome" "$@" 改为 exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox #添加--no-sandbox后即可启动浏览器 /usr/bin/google-chrome --no-sandbox ``` 「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」 赞赏 × 梦白沙 (๑>ڡ<)☆谢谢老板~ 1元 2元 5元 10元 50元 任意金额 2元 使用微信扫描二维码完成支付 版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。 随手发现 2022-09-07 评论 464 次浏览