Skip to content

大佬,请教一个问题:pnpm run serve 是如何通知浏览器安装或更新用户脚本的呢? #74

Answered by lisonge
juedui0769 asked this question in Q&A
Discussion options

You must be logged in to vote

这是在和油猴插件通信吗?

不是


这个功能是如何实现的呢?

vite-plugin-monkey 只是调用浏览器打开 http://127.0.0.1:5173/__vite-plugin-monkey.install.user.js?origin=http://127.0.0.1:5173

浏览器扩展比如 tampermonkey 会自动识别 *.user.js 这种 url 然后打开它的安装页面

openBrowser(serverConfig.installUrl, true, logger);

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by juedui0769
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants