①浏览器右键选择菜单关闭
window.oncontextmenu = function(event) {
event.preventDefault();
event.stopPropagation();
console.log("Right Click Disabled");
return false;
};
window.oncontextmenu = (e) => {
e.preventDefault();
e.stopPropagation();
console.log("Right Click Disabled");
return false;
}
②打印输出窗口
window.alert("Hello world!");
③浏览器内的按钮调用【涉及同源安全策略限制的无法访问】
var btns = document.getElementsByTagName('button');
alert(btns.length);
var btns = document.getElementsByTagName('button');
alert(btns.length);btns[3].onclick();
var btns = document.getElementsByTagName('button');
alert(btns[0]);
测试web端下载:https://download.csdn.net/download/weixin_47428955/85451662?spm=1001.2014.3001.5503
④另一个网址【本网址受到同源策略阻止只有部分元素能访问】
https://view.officeapps.live.com/op/view.aspx?src=http://mczaiyun.top/ht/2.ppt
var btns = document.getElementById('load_img');
alert(btns);
以及“wacframe”参数也能调用
var sumDocument= document.getElementById('wacframe');;
alert(sumDocument);
文章评论