- Progressive Web Application Development by Example
- Chris Love
- 67字
- 2021-08-05 10:33:21
Disabling the homescreen prompt
The beforeinstallprompt event can also be used to suppress Chrome's automatic prompt. This time, like breaking the default form submission, call the preventDefault function and return false:
window.addEventListener('beforeinstallprompt', function(e) { e.preventDefault(); return false; });
This will block the behavior in Chrome. Right now, I don't know how to suppress the prompt on other platforms as they do not support the beforeinstallprompt event yet.
推薦閱讀
- Twilio Cookbook
- Building Django 2.0 Web Applications
- 工業(yè)控制網(wǎng)絡(luò)安全技術(shù)與實(shí)踐
- 通信簡史:從信鴿到6G+
- 企業(yè)私有云建設(shè)指南
- Learning Swift(Second Edition)
- React Cookbook
- 網(wǎng)絡(luò)AI+:2030后的未來網(wǎng)絡(luò)
- Learning Node.js Development
- Implementing NetScaler VPX?
- Dart Cookbook
- 園區(qū)網(wǎng)絡(luò)架構(gòu)與技術(shù)
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)
- 黑客與反黑工具使用詳解
- 物聯(lián)網(wǎng)傳感器技術(shù)與應(yīng)用