Commit 50da22ca by libai

测试

parent 5149b689
Showing with 4 additions and 0 deletions
...@@ -15,6 +15,7 @@ const addBtn = document.querySelector('.add-button'); ...@@ -15,6 +15,7 @@ const addBtn = document.querySelector('.add-button');
addBtn.style.display = 'none'; addBtn.style.display = 'none';
window.addEventListener('beforeinstallprompt', (e) => { window.addEventListener('beforeinstallprompt', (e) => {
setTimeout(function() {
// Prevent Chrome 67 and earlier from automatically showing the prompt // Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault(); e.preventDefault();
// Stash the event so it can be triggered later. // Stash the event so it can be triggered later.
...@@ -37,4 +38,6 @@ window.addEventListener('beforeinstallprompt', (e) => { ...@@ -37,4 +38,6 @@ window.addEventListener('beforeinstallprompt', (e) => {
deferredPrompt = null; deferredPrompt = null;
}); });
}); });
}, 5000);
}); });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment