-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbookmarklet.htm
More file actions
94 lines (83 loc) · 3.96 KB
/
bookmarklet.htm
File metadata and controls
94 lines (83 loc) · 3.96 KB
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
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<a href="javascript:(function() {
var bodyChildren = document.body.children;
var len = bodyChildren.length;
for (var i = 1; i <= len; i++) {
var child = bodyChildren[len - i];
child.parentNode.removeChild(child);
}
var url = window.location.href;
var frame = document.createElement('iframe');
frame.id = 'responsiveFrame';
frame.src = url;
frame.style.width = '320px';
frame.style.height = '480px';
frame.style.backgroundColor = '#fff';
var div = document.createElement('div');
div.style.margin = '0 auto';
div.style.textAlign = 'center';
div.appendChild(frame);
var refresh = document.createElement('a');
refresh.style.color = '#fff';
refresh.innerHTML = 'Refresh the Frame';
refresh.href = 'javascript:document.getElementById(\'responsiveFrame\').src += \' \'';
refresh.style.float = 'right';
div.appendChild(refresh);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPhone - Portrait';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'320px\';document.getElementById(\'responsiveFrame\').style.height=\'480px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
iphone.style.margin = '10px 0 0 0';
div.appendChild(iphone);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPhone - Landscape';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'480px\';document.getElementById(\'responsiveFrame\').style.height=\'320px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
div.appendChild(iphone);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPhone 5 - Portrait';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'320px\';document.getElementById(\'responsiveFrame\').style.height=\'568px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
iphone.style.margin = '10px 0 0 0';
div.appendChild(iphone);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPhone 5 - Landscape';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'568px\';document.getElementById(\'responsiveFrame\').style.height=\'320px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
div.appendChild(iphone);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPad - Portrait';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'768px\';document.getElementById(\'responsiveFrame\').style.height=\'1024px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
iphone.style.margin = '10px 0 0 0';
div.appendChild(iphone);
var iphone = document.createElement('a');
iphone.style.color = '#fff';
iphone.innerHTML = 'iPad - Landscape';
iphone.href = 'javascript: document.getElementById(\'responsiveFrame\').style.width=\'1024px\';document.getElementById(\'responsiveFrame\').style.height=\'768px\';';
iphone.style.float = 'right';
iphone.style.clear = 'right';
div.appendChild(iphone);
document.body.style.backgroundColor = '#333';
document.body.style.background = '#333';
document.body.style.backgroundImage = 'none';
document.body.appendChild(div);
})();">Responsive Testing</a>
</body>
</html>