testing/talos/talos/generate-tresize-xpi.html
author Sebastian Hengst <archaeopteryx@coole-files.de>
Thu, 29 Jun 2017 01:01:15 +0200
changeset 366665 36ea00c880db9a3a16e5e9e8441bdf87e3012f81
parent 366639 1cd9e27f0fa16bd65edc431ca37bbcd5ad72b3bd
child 367193 003e74a2a953449614ea1355f7f5b9dfdcf1654c
permissions -rw-r--r--
Backed out changeset 1cd9e27f0fa1 (bug 1351608)

<html>
 <!--
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 -->
<head>
  <meta charset="UTF-8"/>
  <title>Tresize addon xpi generator</title>
  <script src="scripts/jszip.min.js"></script>
  <script src="scripts/xpigen.js"></script>

  <script>
    /* import-globals-from scripts/xpigen.js */
    var base = "startup_test/tresize/addon/";
    var files = [
      "chrome.manifest",
      "install.rdf",
      "content/framescript.js",
      "content/Profiler.js",
      "content/tresize.overlay.xul",
      "content/tresize.js",
      "content/tresize-test.html"
    ];

    function triggerBuildXpi() {
      function $(id) { return document.getElementById(id); }

      $("status-text").innerHTML = "Preparing ...";
      $("result").style.display = "none";
      $("status").style.display = "inline";

      createXpiDataUri(base, files, {
        onprogress(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; },

        onerror(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.<br/>" + e; },

        onsuccess(u) {
 $("xpi-link").href = u;
                              $("status").style.display = "none";
                              $("result").style.display = "inline";
}
      });
    }
  </script>
</head>

<body onload="triggerBuildXpi()" style="font-family: sans-serif; color:#555">

  <h3>TResize addon</h3>
  <h4>
    Install / Download:
    <span id="status">
      <span id="status-text" style="color: #c40;">Not ready</span>
    </span>

    <span id="result" style="display: none;">
      <a id="xpi-link" href="#" style="background-color: #dfd;">tresize.xpi</a><br/>
      <span style="color: grey";>(gibberish file name is expected, just rename/save as tresize.xpi)</span>
    </span>
  </h4>

  <p>
    Once installed, to run Tresize tests, visit
    <span style="color: green; font-family: monospace;">chrome://tresize/content/tresize-test.html</span>
    and follow the instructions.
  </p>
  <p>
    You can also build the addon yourself on a local talos repo: zip the content
    of <span style="font-family: monospace;">talos/statup_test/tresize/addon/</span> and rename the zip to xpi.
  </p>

</body>
</html>