| <!DOCTYPE html> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| |
| |
| <html> |
| <head> |
| <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" /> |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 --> |
| <title>Cordova Mobile Spec</title> |
| <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8"> |
| <script type="text/javascript" charset="utf-8" src="../cordova.js"></script> |
| |
| |
| <script type="text/javascript" charset="utf-8"> |
| |
| var deviceReady = false; |
| |
| /** |
| * Function called when page has finished loading. |
| */ |
| function init() { |
| document.addEventListener("deviceready", function() { |
| deviceReady = true; |
| console.log("Device="+device.platform+" "+device.version); |
| }, false); |
| function updateUserAgent() { |
| document.getElementById("user-agent").textContent = navigator.userAgent; |
| } |
| updateUserAgent(); |
| window.setInterval(updateUserAgent, 1500); |
| window.setTimeout(function() { |
| if (!deviceReady) { |
| alert("Error: Apache Cordova did not initialize. Demo will not run correctly."); |
| } |
| },1000); |
| } |
| |
| function openWithErrorHandler(url) { |
| var iab = window.open(url, '_blank', 'location=yes'); |
| iab.addEventListener('loaderror', |
| function(error) { |
| alert("Error Channel Fired\nCode: " + error.code + "\nMessage: " +error.message); |
| } |
| ); |
| } |
| </script> |
| |
| </head> |
| <body onload="init();" id="stage" class="theme"> |
| |
| <h1>InAppBrowser</h1> |
| <div id="info"> |
| Make sure http://www.google.com is white listed. </br> |
| Make sure http://www.apple.com is not in the white list.</br> In iOS, starred <span style="vertial-align:super">*</span> tests will leave the app with no way to return. </br> |
| <h4>User-Agent: <span id="user-agent"> </span></h4> |
| </div> |
| <div onclick="backHome();">Back</div> |
| <h1>Local URL</h1> |
| <div class="btn large" onclick="window.open('local.html');">Default: CordovaWebView</div> |
| <div class="btn large" onclick="window.open('local.html', '_self');">Target=Self: CordovaWebView</div> |
| <div class="btn large" onclick="window.open('local.html', '_system');">Target=System: Error</div> |
| <div class="btn large" onclick="window.open('local.html', '_blank');">Target=Blank: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('local.html', 'random_string');">Target=Random: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('local.html', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div> |
| <h1>White Listed URL</h1> |
| <div class="btn large" onclick="window.open('http://www.google.com');">Default: CordovaWebView<span style="vertical-align:super">*</span></div> |
| <div class="btn large" onclick="window.open('http://www.google.com', '_self');">Target=Self: CordovaWebView<span style="vertical-align:super">*</span></div> |
| <div class="btn large" onclick="window.open('http://www.google.com', '_system');">Target=System: System Browser</div> |
| <div class="btn large" onclick="window.open('http://www.google.com', '_blank');">Target=Blank: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.google.com', 'random_string');">Target=Random: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.google.com', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div> |
| <h1>Non White Listed URL</h1> |
| <div class="btn large" onclick="window.open('http://www.apple.com');">Default: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.apple.com', '_self');">Target=Self: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.apple.com', '_system');">Target=System: System</div> |
| <div class="btn large" onclick="window.open('http://www.apple.com', '_blank');">Target=Blank: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.apple.com', 'random_string');">Target=Random: InAppBrowser</div> |
| <div class="btn large" onclick="window.open('http://www.apple.com', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div> |
| <h1>PDF URL</h1> |
| <div class="btn large" onclick="window.open('http://www.stluciadance.com/prospectus_file/sample.pdf');">Remote URL</div> |
| <div class="btn large" onclick="window.open('local.pdf', '_blank');">Local URL</div> |
| <h1>INVALID URL</h1> |
| <div class="btn large" onclick="openWithErrorHandler('x-ttp://www.invalid.com/');">Invalid Scheme</div> |
| <div class="btn large" onclick="openWithErrorHandler('http://www.inv;alid.com/');">Invalid Host</div> |
| <div class="btn large" onclick="openWithErrorHandler('nonexistent.html');">Missing File</div> |
| <h2> </h2><div class="backBtn" onclick="backHome();">Back</div> |
| </body> |
| </html> |