Created
September 11, 2022 16:54
-
-
Save kmahyyg/643d9c0dc90af8606e7e8ec379216ca4 to your computer and use it in GitHub Desktop.
Get Out Of WeChat In-APP Browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta lang="zh-CN"> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<style> | |
#detection_res { | |
color: red; | |
font-size: large; | |
} | |
#network_typ { | |
color: blue; | |
font-size: large; | |
} | |
</style> | |
</head> | |
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script> | |
<body> | |
<h1>Detect WC</h1> | |
<script> | |
// VConsole will be exported to `window.VConsole` by default. | |
var vConsole = new window.VConsole(); | |
</script> | |
<script> | |
function detectNow() { | |
if (typeof WeixinJSBridge == "undefined") { | |
document.getElementById('detection_res').innerText = 'Not detected!'; | |
} else { | |
document.getElementById('detection_res').innerText = 'Fuck Zhang Xiaolong. DETECTED.'; | |
WeixinJSBridge.invoke('getNetworkType',{},function (e){ | |
document.getElementById('network_typ').innerText = 'Network Type: ' + e.err_msg.slice(13); | |
}); | |
} | |
} | |
</script> | |
<p id="detection_res">Pending for Detection.</p> | |
<p id="network_typ">Network Type Unknown. </p> | |
<script> | |
detectNow(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment