当前位置:网站首页>H5 close the current page, including wechat browser (with source code)
H5 close the current page, including wechat browser (with source code)
2022-06-26 15:52:00 【Heart piercing mania】
In wechat browser window.close() Can't close the web page , So use it alone WeixinJSBridge.call('closeWindow');
We can judge whether the current browser is wechat browser
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
console.log(' Wechat browser ');
} else {
console.log(' Not wechat browser ');
}
Wechat browser
WeixinJSBridge.call('closeWindow');
Other browsers
window.close()
It's a perfect solution !!!!!
边栏推荐
- 学习内存屏障
- JS creative icon navigation menu switch background color
- 北京房山区专精特新小巨人企业认定条件,补贴50万
- NFT合约基础知识讲解
- AbortController的使用
- A blog to thoroughly master the theory and practice of particle filter (PF) (matlab version)
- 面试踩坑总结一
- golang 临时对象池优化
- [applet practice series] Introduction to the registration life cycle of the applet framework page
- 零知识 QAP 问题的转化
猜你喜欢
Everyone is a scientist free gas experience Mint love crash
Svg canvas canvas drag
Utilisation d'abortcontroller
NFT 平台安全指南(2)
查词翻译类应用使用数据接口api总结
Svg capital letter a animation JS effect
Svg animation around the earth JS special effects
Reflection modification final
如何辨别合约问题
High frequency interview 𞓜 Flink Shuangliu join
随机推荐
北京房山区专精特新小巨人企业认定条件,补贴50万
Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
Utilisation d'abortcontroller
有Cmake的工程交叉编译到链接时报错找不到.so动态库文件
Use of abortcontroller
[graduation season · advanced technology Er] what is a wechat applet, which will help you open the door of the applet
【leetcode】112. Path sum - 113 Path sum II
On which platform is it safe to buy shares and open an account? Ask for guidance
5000 word analysis: the way of container security attack and defense in actual combat scenarios
2022 Beijing Shijingshan District specializes in the application process for special new small and medium-sized enterprises, with a subsidy of 100000-200000 yuan
TweenMax+SVG切换颜色动画场景
PCIe Capabilities List
人人都当科学家之免Gas体验mint爱死机
【思考】在买NFT的时候你在买什么?
How to handle 2gcsv files that cannot be opened? Use byzer
CNN optimized trick
如何辨别合约问题
Solana capacity expansion mechanism analysis (1): an extreme attempt to sacrifice availability for efficiency | catchervc research
NFT 项目的开发、部署、上线的流程(1)
JS events