Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: PWA install prompt
Browse files Browse the repository at this point in the history
FranGuam committed May 27, 2024
1 parent fe42836 commit 435d31f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -32,6 +32,9 @@ root.render(
</React.StrictMode>,
);

// 这是PWA自动弹出安装提示的代码,可以拦截并在之后需要的时候再调用event.prompt()弹出安装提示(暂未实现)
window.addEventListener("beforeinstallprompt", (event) => {});

// Measuring performance in our app, pass a function
// Learn more: https://github.com/GoogleChrome/web-vitals, https://bit.ly/CRA-vitals
if (process.env.NODE_ENV === "development") {

0 comments on commit 435d31f

Please sign in to comment.