use*_*584 20 javascript php forms jquery
我想隐藏来自视图代码/检查元素浏览器的表单代码,我该怎么做?
这是我的代码,请看下面:
<div style=" text-align: center; padding: 300px; font-family: lato; ">
Please wait redirect page ......<br>
<img src="http://maps.nrel.gov/sites/all/modules/custom_modules/hydra/assets/images/loading_bar.gif" border="0">
</div>
<form name="f1" action="payments.php" method="post">
<input type="hidden" name="id_crad" value="...">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="12.99">
</form>
<script type="text/javascript">
setTimeout(function(){f1.submit();}, 3000);
</script>
Run Code Online (Sandbox Code Playgroud)
请看图片

Koa*_*ung 20
你根本做不到.
代码检查器旨在调试HTML和Javascript.他们通过显示网页的实时DOM对象来实现.这意味着它会显示您在页面上看到的所有内容的HTML代码,即使它们是由Javascript生成的.一些检查员甚至在iframe中显示代码.
Nay*_*Das 18
有一种智能方法可以禁用网站中的inspect元素.只需在脚本标记内添加以下代码段:
$(document).bind("contextmenu",function(e) {
e.preventDefault();
});
Run Code Online (Sandbox Code Playgroud)
请查看此博客
直接从浏览器中取出inspect元素的功能键F12,我们也可以通过使用以下代码禁用它:
$(document).keydown(function(e){
if(e.which === 123){
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
小智 12
您可以使用此代码 -
阻止右键单击 -
<body oncontextmenu="return false;">
Run Code Online (Sandbox Code Playgroud)
块键 - 您应该在 body 标签的上部使用它。(在 head 标签中使用)
<script>
document.onkeydown = function (e) {
if (event.keyCode == 123) {
return false;
}
if (e.ctrlKey && e.shiftKey && (e.keyCode == 'I'.charCodeAt(0) || e.keyCode == 'i'.charCodeAt(0))) {
return false;
}
if (e.ctrlKey && e.shiftKey && (e.keyCode == 'C'.charCodeAt(0) || e.keyCode == 'c'.charCodeAt(0))) {
return false;
}
if (e.ctrlKey && e.shiftKey && (e.keyCode == 'J'.charCodeAt(0) || e.keyCode == 'j'.charCodeAt(0))) {
return false;
}
if (e.ctrlKey && (e.keyCode == 'U'.charCodeAt(0) || e.keyCode == 'u'.charCodeAt(0))) {
return false;
}
if (e.ctrlKey && (e.keyCode == 'S'.charCodeAt(0) || e.keyCode == 's'.charCodeAt(0))) {
return false;
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
小智 6
您可以添加此脚本以在用户注意时出错:D
试试这个代码
<script type="text/javascript">
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(3(){(3 a(){8{(3 b(2){7((\'\'+(2/2)).6!==1||2%5===0){(3(){}).9(\'4\')()}c{4}b(++2)})(0)}d(e){g(a,f)}})()})();',17,17,'||i|function|debugger|20|length|if|try|constructor|||else|catch||5000|setTimeout'.split('|'),0,{}))
</script>Run Code Online (Sandbox Code Playgroud)
来自http://www.bloggerku.com/2017/08/memasang-anti-inspect.html
小智 5
当调试器打开时,此代码从 dom 中删除元素的内部 html(在 Chrome 和 IE 中测试)
var currentInnerHtml;
var element = new Image();
var elementWithHiddenContent = document.querySelector("#element-to-hide");
var innerHtml = elementWithHiddenContent.innerHTML;
element.__defineGetter__("id", function() {
currentInnerHtml = "";
});
setInterval(function() {
currentInnerHtml = innerHtml;
console.log(element);
console.clear();
elementWithHiddenContent.innerHTML = currentInnerHtml;
}, 1000);
Run Code Online (Sandbox Code Playgroud)
这#element-to-hide是您要隐藏的元素的 id。这是一个黑客,但我希望它对你有帮助。
| 归档时间: |
|
| 查看次数: |
99508 次 |
| 最近记录: |