摘要: function dataURLtoFile(dataurl, filename) { let arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8a 阅读全文
posted @ 2022-03-18 14:35 前端销纸 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 强制关闭页面并打开一个空白页 function CloseWebPage(){ if (navigator.userAgent.indexOf("Firefox") !== -1 || navigator.userAgent.indexOf("Chrome") ! 1) { window.locat 阅读全文
posted @ 2022-03-18 14:33 前端销纸 阅读(107) 评论(0) 推荐(0) 编辑
摘要: window.addEventListener('visibilitychange',callback) document.visibilityState "hidden" //该属性用于判断是否隐藏 阅读全文
posted @ 2022-03-18 14:32 前端销纸 阅读(284) 评论(0) 推荐(0) 编辑
摘要: history.pushState(null, null, document.URL); window.addEventListener("popstate", watchPopEvent,false) 阅读全文
posted @ 2022-03-18 14:26 前端销纸 阅读(134) 评论(0) 推荐(0) 编辑