dom/tests/mochitest/webapps/file_bug_779982.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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