-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht6.html
87 lines (59 loc) · 2.13 KB
/
t6.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script type="text/javascript">
// select the target node
var target = document
delete HTMLElement.prototype.onclick
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation);
if(mutation.addedNodes.length > 0){
if(mutation.addedNodes[0].hasAttribute && mutation.addedNodes[0].hasAttribute('onerror')){
//mutation.addedNodes[0].removeAttribute('onerror')
}
//console.log(mutation.addedNodes[0])
}
});
});
// configuration of the observer:
var config = { attributes: true, childList: true, characterData: true, subtree:true }
// pass in the target node, as well as the observer options
observer.observe(target, config);
function test (e) {
"use strict"
console.log(e.callee)
alert('1')
}
</script>
</head>
<body onload='console.log("testddd")'>
<div id="hello" name='hello2'>
<button id="test" onclick='alert("1")'>click</button>
</div>
<img src="xx" onerror='test(arguments)' />
<div id="cla" style="\63	\06f
\0006c\00006F
\R:\000072 Ed;color\0\bla:yellow\0\bla;col\0\00 \ or:blue;">XXX</div>
<IMG SRC="\63	jAvascript:alert('test2')">
<script class="test">
console.log(document.currentScript)
var c = document.currentScript
var fun;
(function(){
console.log('inside module', document.currentScript)
fun = function(e){
console.log('inside fun', document.currentScript, e)
}
})()
var cd = document.currentScript;
window.onload=()=>{ fun(cd)}
var el =document.getElementById('hello')
Object.defineProperty(el, 'test', {writable:false, configurable:false, value: 1})
var el2 =document.getElementById('hello')
</script>
</body>
</html>