我想使用浏览器打开“查看源代码”
为什么不允许这样做?
**window.open("view-source:" +window.location.href, '_blank');**
<script>
//this just example well view-source:https://stackoverflow.com
alert("view-source:" +window.location.href);
//result view-source:https://stackoverflow.com
/*then my problem is window.open() function like this*/
window.open("view-source:" +window.location.href, '_blank');
//The coding is right but not call VIEW SOURCE:
if(window.open("view-source:" +window.location.href, '_blank') || "view-source:" +window.location.href){
document.write('<html>hurricane war LOL</html>');
}
<script>