-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.html
65 lines (51 loc) · 1.44 KB
/
demo.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
<!DOCTYPE html>
<!--
EvilVibrate
An information security project proof of concept
-->
<html>
<body>
<!-- load the stylesheet for the images -->
<link rel=stylesheet href="style.css" type="text/css">
<!-- load mootools-core for the class to work -->
<script type="text/javascript" src="http://mootools.net/download/get/mootools-core-1.4.5-full-nocompat.js">
</script>
<!-- load evilvibrate -->
<script type="text/javascript" src="EvilVibrate.js">
</script>
<script type="text/javascript">
// handle useragent
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
var isIphone = ua.indexOf("iphone") > -1;
var isWindows = ua.indexOf("iemobile") > -1;
// vibrate will be a new EvilVibrate
var vibrate;
// android!
if(isAndroid) {
vibrate = new EvilVibrate("android4");
vibrate.vibrate();
document.write(vibrate.html());
}
// iPhone!
else if(isIphone) {
vibrate = new EvilVibrate("iphone");
vibrate.vibrate();
document.write(vibrate.html());
}
// WinPhone!
else if(isWindows) {
vibrate = new EvilVibrate("winphone");
vibrate.vibrate();
document.write(vibrate.html());
}
// if we don't recognize, I'm default to android4 here
// could do something else in future iterations.
else {
vibrate = new EvilVibrate("android4");
vibrate.vibrate();
document.write(vibrate.html());
}
</script>
</body>
</html>