Last active
April 4, 2018 07:41
-
-
Save moesoha/ce09516a370893be4bd8c353267d23f5 to your computer and use it in GitHub Desktop.
Load vConsole when `console` appears in `document.location.search` with one-line snippet
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
window.document.location.search.substr(1).split('&').forEach(function (v){ | |
if(v.split('=')[0] == 'console'){ | |
if(!window.VConsole){ | |
var s = document.createElement('script'); | |
s.src = 'https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js'; | |
window.document.body.appendChild(s); | |
} | |
var c=setInterval(function (){ | |
if(window.VConsole){ | |
clearInterval(c); | |
window.vConsole = new VConsole(); | |
} | |
},1000); | |
} | |
}); |
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
window.document.location.search.substr(1).split('&').forEach(function (v){if(v.split('=')[0]=='console'){if(!window.VConsole){var s=document.createElement('script');s.src='https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js';window.document.body.appendChild(s);}var c=setInterval(function (){if(window.VConsole){clearInterval(c);window.vConsole=new VConsole();}},1000);}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment