Files
tubestation/browser/components/loop/standalone/content/index.html

163 lines
6.3 KiB
HTML

<!DOCTYPE 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/. -->
<html>
<head>
<meta charset="utf-8">
<meta name="locales" content="en-US" />
<meta name="default_locale" content="en-US" />
<meta name="referrer" content="origin" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="shared/css/reset.css">
<link rel="stylesheet" type="text/css" href="shared/css/common.css">
<link rel="stylesheet" type="text/css" href="shared/css/conversation.css">
<link rel="stylesheet" type="text/css" href="css/webapp.css">
<link rel="localization" href="l10n/{locale}/loop.properties">
<script>
function insertScript(url, sync) {
var node = document.createElement("script");
var sibling = document.getElementsByTagName("script")[0];
node.async = !sync;
node.src = url;
sibling.parentNode.insertBefore(node, sibling);
}
/**
* Synchronously load the supplied script into the DOM (using <script>).
* Eventually, we probably want to do a full build step even for
* development, after which this can go away.
*
* Instead of having to specify the scripts we need here, and in
* some webpack config file for bundling, we specify them in
* webappEntryPoint.js, which require()s them. Webpack handles that
* during bundling, but for the current dev-server setup, where we don't
* (yet) have a full build step, we need to provide a require() function.
*
* @param webpackUrl - a URL, possibly preceded by webpack loader syntax.
* webpack loader syntax is stripped off
*
*/
function require(url) {
var devTimeUrl = url.replace(/^script!/, '');
var devTimeUrl = devTimeUrl.replace(/^imports.*!/, '');
var devTimeUrl = devTimeUrl.replace(/^exports.*!/, '');
insertScript(devTimeUrl, true);
}
(function() {
// window.navigator.doNotTrack "yes" is for old versions of FF
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
// window.doNotTrack is Safari + IE11
// window.navigator.msDoNotTrack for IE9 and IE10
// See also
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack#Browser_compatibility
if (window.navigator.doNotTrack !== "yes" &&
window.navigator.doNotTrack !== "1" &&
window.doNotTrack !== "1" &&
window.navigator.msDoNotTrack !== "1") {
insertScript("//cdn.optimizely.com/js/2768540301.js");
// This is an unfolded, readable version of the official GA inclusion
// script.
window.GoogleAnalyticsObject = "ga";
window.ga = window.ga || function() {
(window.ga.q = window.ga.q || []).push(arguments);
};
window.ga.l = 1 * new Date();
insertScript("//www.google-analytics.com/analytics.js");
window.ga("create", "UA-36116321-15", "auto");
/* Don't send conversation ids to GA, by specifying our own location. */
window.ga("set", {
"location": document.location.origin + "/conversation/",
"anonymizeIp": true,
"title": "Link Clicker"
});
window.ga("send", "pageview");
}
})();
</script>
</head>
<body class="standalone">
<div id="main"></div>
<!-- libs -->
<script>
// IE9, 10, and 11 lack the window.CustomEvent constructor. IE11 has the
// window.CustomEvent object, but it throws when new CustomEvent(...) is
// called, with the exception of "Object doesn't support this action". IE9
// introduced document.createEvent. Nothing we can do for IE8 here.
var customEventCtorWorks;
try {
if (window.CustomEvent) {
customEventCtorWorks = new CustomEvent("test", {"detail":{"sampleProperty":true}});
}
} catch (ex) {}
var basicCustomEvent = document.createEvent("CustomEvent");
if (!customEventCtorWorks && basicCustomEvent && basicCustomEvent.initCustomEvent) {
function myCustomEvent(event, params) {
params = params || {bubbles: false, cancelable: false, detail: undefined};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
myCustomEvent.prototype = window.Event.prototype;
window.CustomEvent = myCustomEvent;
}
// To support IE for the l10n-gaia library on IE <= 10.
if (!("language" in navigator)) {
navigator.language = navigator.browserLanguage;
}
// To support IE <= 10.
if (!window.MutationObserver) {
// Define a dummy MutationObserver object if one doesn't exist
// This could later be extended to use Mutation events but for
// now this will simply result in no-ops.
function myMutationObserver() {}
myMutationObserver.prototype = {
disconnect: function() {},
observe: function () {},
takeRecords: function() {}
};
window.MutationObserver = myMutationObserver;
}
window.OTProperties = {
cdnURL: "shared/libs/"
};
window.OTProperties.assetURL = window.OTProperties.cdnURL + "sdk-content/";
window.OTProperties.configURL = window.OTProperties.assetURL + "js/dynamic_config.min.js";
// We don't use the SDK's CSS. This will prevent spurious 404 errors.
window.OTProperties.cssURL = "about:blank";
</script>
<script type="text/javascript" src="config.js"></script>
<!-- note that for 'make dist', webappEntryPoint.js is replaced by -->
<!-- the standalone.js bundle -->
<script type="text/javascript" src="webappEntryPoint.js"></script>
<script>
// Wait for all the localization notes to load
window.addEventListener("localized", function() {
loop.webapp.init();
}, false);
</script>
<noscript>
<img src="img/logo.png" border="0" alt="Logo"/>
</noscript>
</body>
</html>