Commit a54bc386 by libai

测试

parent 427e5a20
Showing with 9 additions and 10 deletions
......@@ -382,7 +382,7 @@
<script src="layer-v3.1.0/layer/layer.js"></script>
<!-- <script src="lib/fingerprint2.js"></script> -->
<script src="lib/login.js?v=2022111801"></script>
<script src="index.js?v=2022112398" defer=""></script>
<script src="index.js?v=2022112399" defer=""></script>
<!-- <script src="index.js" defer></script> -->
<!-- <link rel="manifest" href="manifest.webmanifest" /> -->
......
......@@ -15,19 +15,18 @@ const addBtn = document.querySelector('.add-button');
addBtn.style.display = 'none';
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
$(".txt1").on("click",function(){
downShow(e)
})
});
function downShow(){
e.preventDefault();
// Stash the event so it can be triggered later.
deferredPrompt = e;
// Update UI to notify the user they can add to home screen
addBtn.style.display = 'block';
addBtn.addEventListener('click', () => {
// hide our user interface that shows our A2HS button
addBtn.style.display = 'none';
// Show the prompt
deferredPrompt.prompt();
// Wait for the user to respond to the prompt
deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('User accepted the A2HS prompt');
......@@ -37,4 +36,4 @@ window.addEventListener('beforeinstallprompt', (e) => {
deferredPrompt = null;
});
});
});
\ No newline at end of file
}
\ 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