|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta name="viewport" content="width=device-width"> |
| 6 | + <link rel="manifest" href="manifest.json"> |
| 7 | + <link href="https://fonts.googleapis.com/css?family=Hanalei+Fill" rel="stylesheet"> |
| 8 | + |
| 9 | + <title>Test App</title> |
| 10 | + <style type="text/css"> |
| 11 | + section { padding: 1em 0; } |
| 12 | + p.customfont { |
| 13 | + font-family: "Hanalei Fill"; |
| 14 | + color: red; |
| 15 | + } |
| 16 | + |
| 17 | + p.header { |
| 18 | + font: Arial; |
| 19 | + font-weight: bold; |
| 20 | + } |
| 21 | +</style> |
| 22 | + </head> |
| 23 | + <script> |
| 24 | +function myFunction() { |
| 25 | + alert("Yo, I am an alert box!"); |
| 26 | +} |
| 27 | +</script> |
| 28 | + |
| 29 | + |
| 30 | + <body> |
| 31 | + |
| 32 | + <h1>Lets test!</h1> |
| 33 | + |
| 34 | + <h2>Privacy & Security</h2> |
| 35 | + <hr> |
| 36 | + |
| 37 | + <section> |
| 38 | + <p class="header">Tracking Protection (TP) Test Pages</p> |
| 39 | + NOTE: Please use <a href="https://senglehardt.com/test/trackingprotection/test_pages/">https://senglehardt.com/test/trackingprotection/test_pages/</a><br> |
| 40 | + until <a href="https://github.com/mozilla/tracking-test/pull/13">https://github.com/mozilla/tracking-test/pull/13</a> is ready |
| 41 | + |
| 42 | + |
| 43 | + <p class="header">SSL Test</p> |
| 44 | + Very bad SSL (should show up w/ a broken lock!) |
| 45 | + <a href="https://very.badssl.com/">https://very.badssl.com/</a> |
| 46 | + |
| 47 | + <p class="header">Custom Font Test</p> |
| 48 | + <p class="customfont">This is some crazy font text!</p> |
| 49 | + |
| 50 | + <p class="header">Javascript Action Test</p> |
| 51 | + <button onclick="myFunction()">Click here for JS alert</button> |
| 52 | + |
| 53 | + <p class="header">Blocked Cookies Test</p> |
| 54 | + <a href="https://www.whatismybrowser.com/detect/are-cookies-enabled">Are Cookies Enabled?</a><br> |
| 55 | + <a href="https://www.whatismybrowser.com/detect/are-third-party-cookies-enabled">Are 3rd Party Cookies Enabled?</a> |
| 56 | + |
| 57 | + </section> |
| 58 | + |
| 59 | + <h2>HTML Controls</h2> |
| 60 | + <hr> |
| 61 | + |
| 62 | + <section> |
| 63 | + <p class="header">Password Form</p> |
| 64 | + (will show a doorhanger to remember the password) |
| 65 | + <form> |
| 66 | + <input type="text" placeholder="Username" /><br /> |
| 67 | + <input type="password" placeholder="Password" /><br /> |
| 68 | + <input type="submit" /> |
| 69 | + </form> |
| 70 | + </section> |
| 71 | + |
| 72 | + <section> |
| 73 | + <p class="header">Dropdown Menu</p> |
| 74 | + |
| 75 | + <select> |
| 76 | + <option>Some option</option> |
| 77 | + <option>This option</option> |
| 78 | + <option>That option</option> |
| 79 | + <option>Another option</option> |
| 80 | + </select> |
| 81 | + </section> |
| 82 | + |
| 83 | + <section> |
| 84 | + <p class="header">Location Menu</p> |
| 85 | + <button id="location">Get Location</button> |
| 86 | + <p id="location-result"></p> |
| 87 | + </section> |
| 88 | + |
| 89 | + <section> |
| 90 | + <p class="header">File Download</p> |
| 91 | + <a href="https://storage.googleapis.com/mobile_test_assets/public/web_icon.png" download>Download this icon</a> |
| 92 | + </section> |
| 93 | + |
| 94 | + <section> |
| 95 | + <p class="header">Open PDF File</p> |
| 96 | + <a href="https://storage.googleapis.com/mobile_test_assets/public/lorem_ipsum.pdf" target="_blank">Open this PDF File</a> |
| 97 | + </section> |
| 98 | + |
| 99 | + |
| 100 | + <section> |
| 101 | + <p class="header">Date Picker Menu</p> |
| 102 | + <input type="date" placeholder="Pick a Date" /> |
| 103 | + </section> |
| 104 | + |
| 105 | + <section> |
| 106 | + <input type="datetime-local" placeholder="Pick a Date/Time" /> |
| 107 | + </section> |
| 108 | + |
| 109 | + <section> |
| 110 | + <p class="header">Color Picker Menu</p> |
| 111 | + <input type="color" /> |
| 112 | + </section> |
| 113 | + |
| 114 | + <section> |
| 115 | + <p class="header">Input Text Menu</p> |
| 116 | + <p>Make sure you can copy <input type="text" placeholder="and Paste" /> me</p> |
| 117 | + </section> |
| 118 | + |
| 119 | + <p class="header">Misc Link Types</p> |
| 120 | + <section> |
| 121 | + <a href="http://google.com">External link</a> |
| 122 | + </section> |
| 123 | + |
| 124 | + <section> |
| 125 | + <a href='market://details?id=org.mozilla.firefox&referrer="+"utm_source%3Dmozilla%26utm_medium%3DReferral%26utm_campaign%3Dmozilla-org'>External app (play store) using URL (market://...)</a> |
| 126 | + </section> |
| 127 | + |
| 128 | + <section> |
| 129 | + <a href="http://mozilla-mobile.github.io/testapp2/">External app same origin</a><br> |
| 130 | + see: <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy">Same Origin Policy</a> |
| 131 | + </section> |
| 132 | + |
| 133 | + <section> |
| 134 | + <a href="https://m.youtube.com/watch?v=I47Y6VHc3Ms">Link to youtube</a> - make sure video plays |
| 135 | + </section> |
| 136 | + |
| 137 | + <section> |
| 138 | + <a href=" mailto://[email protected]" >Email link </a> |
| 139 | + </section> |
| 140 | + |
| 141 | + <section> |
| 142 | + <a href="tel://+1-234-555-1212">Telephone link</a> |
| 143 | + </section> |
| 144 | + |
| 145 | + |
| 146 | +<h2>Site Permissions</h2> |
| 147 | +<hr> |
| 148 | + |
| 149 | + <section> |
| 150 | + <p class="header">Test Geolocation</p> |
| 151 | + <span id="live-geolocation">click here</span> |
| 152 | + </section> |
| 153 | + |
| 154 | + <section> |
| 155 | + <p class="header">Test Camera Dialogue</p> |
| 156 | + <input id=video type=button value="Open camera" onclick=open_camera() > |
| 157 | + </section> |
| 158 | + |
| 159 | + <section> |
| 160 | + <p class="header">Test Microphone Dialogue</p> |
| 161 | + <input id=audio type=button value="Open microphone" onclick=open_microphone() > |
| 162 | + </section> |
| 163 | + |
| 164 | + <section> |
| 165 | + <p class="header">Test Notifications Dialogue</p> |
| 166 | + <input id=notify type=button value="Open notifications dialogue" onclick=open_notifications() > |
| 167 | + </section> |
| 168 | + |
| 169 | + <script> |
| 170 | + // Grab elements, create settings, etc. |
| 171 | + function open_camera() { |
| 172 | + var video = document.getElementById('video'); |
| 173 | + |
| 174 | + // Get access to the camera! |
| 175 | + if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { |
| 176 | + // Not adding `{ audio: true }` since we only want video now |
| 177 | + navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) { |
| 178 | + //video.src = window.URL.createObjectURL(stream); |
| 179 | + //video.srcObject = stream; |
| 180 | + video.play(); |
| 181 | + }); |
| 182 | + } |
| 183 | + } |
| 184 | + |
| 185 | + function open_microphone() { |
| 186 | + var audio = document.getElementById('audio'); |
| 187 | + |
| 188 | + // Get access to the camera! |
| 189 | + if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { |
| 190 | + // Not adding `{ audio: true }` since we only want audio now |
| 191 | + navigator.mediaDevices.getUserMedia({ audio: true }).then(function(stream) { |
| 192 | + //audio.src = window.URL.createObjectURL(stream); |
| 193 | + //audio.srcObject = stream; |
| 194 | + audio.play(); |
| 195 | + }); |
| 196 | + } |
| 197 | + } |
| 198 | + |
| 199 | + function open_notifications() { |
| 200 | + Notification.requestPermission().then(function(result) { |
| 201 | + if (result === 'denied') { |
| 202 | + console.log('Permission wasn\'t granted. Allow a retry.'); |
| 203 | + return; |
| 204 | + } |
| 205 | + if (result === 'default') { |
| 206 | + console.log('The permission request was dismissed.'); |
| 207 | + return; |
| 208 | + } |
| 209 | + // Do something with the granted permission. |
| 210 | + }); |
| 211 | + } |
| 212 | + </script> |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | +<h2>Other</h2> |
| 217 | +<hr> |
| 218 | + <section> |
| 219 | + <p class="header">File Upload</p> |
| 220 | + <a href="https://webcompat.com/issues/new?url=http%3A%2F%2Fwww.mozilla.org">Web Compat Reporting Tool</a> |
| 221 | + </section> |
| 222 | + |
| 223 | + </body> |
| 224 | + |
| 225 | + <script src="j/jquery.js"></script> |
| 226 | + <script src="j/geoPosition.js"></script> |
| 227 | + <script src="//maps.googleapis.com/maps/api/js?sensor=true"></script> |
| 228 | + <script> |
| 229 | + function supports(bool, suffix) { |
| 230 | + var s = "Your browser "; |
| 231 | + if (bool) { |
| 232 | + s += "supports " + suffix + "."; |
| 233 | + } else { |
| 234 | + s += "does not support " + suffix + ". :("; |
| 235 | + } |
| 236 | + return s; |
| 237 | + } |
| 238 | + function lookup_location() { |
| 239 | + geoPosition.getCurrentPosition(show_map, show_map_error); |
| 240 | + } |
| 241 | + function show_map(loc) { |
| 242 | + $("#geo-wrapper").css({'width':'320px','height':'350px'}); |
| 243 | + var map = new google.maps.Map(document.getElementById("geo-wrapper"), {zoom: 14, mapTypeControl:true, zoomControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP}); |
| 244 | + var center = new google.maps.LatLng(loc.coords.latitude,loc.coords.longitude); |
| 245 | + map.setCenter(center); |
| 246 | + var marker = new google.maps.Marker({map: map, position: center, draggable: false, title: "You are here (more or less)"}); |
| 247 | + } |
| 248 | + function show_map_error() { |
| 249 | + $("#live-geolocation").html('Unable to determine your location.'); |
| 250 | + } |
| 251 | + $(function() { |
| 252 | + if (geoPosition.init()) { |
| 253 | + $("#live-geolocation").html(supports(true, "geolocation") + '<br><input type=button value="Open Geolocation" onclick="lookup_location();return false">'); |
| 254 | + } else { |
| 255 | + $("#live-geolocation").html(supports(false, "geolocation")); |
| 256 | + } |
| 257 | + }); |
| 258 | + </script> |
| 259 | + |
| 260 | + <script type="text/javascript"> |
| 261 | + document.getElementById('location').addEventListener('click', function() { |
| 262 | + navigator.geolocation.getCurrentPosition(function(pos) { |
| 263 | + document.getElementById('location-result').innerText = JSON.stringify({ |
| 264 | + longitude: pos.coords.longitude, |
| 265 | + latitude: pos.coords.latitude |
| 266 | + }); |
| 267 | + }); |
| 268 | + }); |
| 269 | + </script> |
| 270 | + |
| 271 | +</html> |
0 commit comments