<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">

<script>
'use strict';
// Workaround for JSzip requiring window.
if (tr.isHeadless) {
  /**
   * Hack.
   */
  global.window = {};
}
</script>
<script src="/jszip.min.js"></script>
<script>
'use strict';
// Workaround for JSzip requiring window.
if (tr.isHeadless) {
  /**
   * Hack.
   */
  global.JSZip = global.window.JSZip;
  global.window = undefined;
}
</script>

<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">

<script>
'use strict';
// Vinn workaround for JSzip requiring window.
if (tr.isVinn) {
  /**
   * Hack.
   */
  global.window = {};
}
</script>
<script src="/jszip.min.js"></script>
<script>
'use strict';
// Vinn workaround for JSzip requiring window.
if (tr.isVinn) {
  /**
   * Hack.
   */
  global.JSZip = global.window.JSZip;
  global.window = undefined;
} else if (tr.isNode) {
  var jsZipAbsPath = HTMLImportsLoader.hrefToAbsolutePath(
      '/jszip.min.js');
  var jsZipModule = require(jsZipAbsPath);
  global.JSZip = jsZipModule;
}
</script>

Fix JSzip import in node
Fix JSzip import in node

jszip is also node-aware so we have to apply the same hack to bring it
into the global object.

TBR=nduca
BUG=catapult:#1991

Review URL: https://codereview.chromium.org/1683663002
