dom/tests/mochitest/webapps/file_bug_779982.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE html>
     2 <html>
     3   <body>
     4     foobar!
     5   </body>
     6   <script>
     7     var finished = false;
     8     var data = window.location.search.substring(1).split('&');
    10     function finish(value) {
    11       value ? alert('success') : alert('failure');
    12       finished = true;
    13     }
    15     switch (data[0]) {
    16       case "getSelf":
    17         navigator.mozApps.getSelf().onsuccess = function onGetSelf() {
    18           if (data[1] == 'true') {
    19             finish(this.result == null);
    20           } else {
    21             finish(this.result != null);
    22           }
    23         }
    24         break;
    26       case "checkInstalled":
    27         navigator.mozApps.checkInstalled('http://example.org/manifest.webapp').onsuccess = function onCheckInstalled() {
    28           if (data[1] == 'true') {
    29             finish(!this.result);
    30           } else {
    31             finish(!!this.result);
    32           }
    33         }
    34         break;
    36       case "checkInstalledWrong":
    37         try {
    38           navigator.mozApps.checkInstalled('http://something.org/manifest.webapp');
    39           finish(false);
    40         } catch (e) {
    41           finish(true);
    42         }
    43         break;
    45       default:
    46         finish(false);
    47         break;
    48     }
    49   </script>
    50 </html>

mercurial