mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 17:49:52 +00:00
# Conflicts: # codecs/cpp.Dockerfile # codecs/imagequant/example.html # codecs/webp/dec/webp_dec.d.ts # codecs/webp/dec/webp_dec.js # codecs/webp/dec/webp_dec.wasm # codecs/webp/enc/webp_enc.d.ts # codecs/webp/enc/webp_enc.js # codecs/webp/enc/webp_enc.wasm # package-lock.json # package.json # src/codecs/tiny.webp # src_old/codecs/encoders.ts # src_old/codecs/processor-worker/tiny.avif # src_old/codecs/processor-worker/tiny.webp # src_old/codecs/tiny.webp # src_old/components/compress/index.tsx # src_old/lib/util.ts # src_old/sw/util.ts
34 lines
976 B
TypeScript
34 lines
976 B
TypeScript
declare module '@webcomponents/custom-elements';
|
|
|
|
function init() {
|
|
require('./init-app.tsx');
|
|
}
|
|
|
|
if (!('customElements' in self)) {
|
|
import(
|
|
/* webpackChunkName: "wc-polyfill" */
|
|
'@webcomponents/custom-elements'
|
|
).then(init);
|
|
} else {
|
|
init();
|
|
}
|
|
|
|
if (typeof PRERENDER === 'undefined') {
|
|
// Determine the current display mode.
|
|
let displayMode = 'browser';
|
|
const mqStandAlone = '(display-mode: standalone)';
|
|
if (navigator.standalone || window.matchMedia(mqStandAlone).matches) {
|
|
displayMode = 'standalone';
|
|
}
|
|
// Setup analytics
|
|
window.ga = window.ga || ((...args) => (ga.q = ga.q || []).push(args));
|
|
ga('create', 'UA-128752250-1', 'auto');
|
|
ga('set', 'transport', 'beacon');
|
|
ga('set', 'dimension1', displayMode);
|
|
ga('send', 'pageview', '/index.html', { title: 'Squoosh' });
|
|
// Load the GA script
|
|
const s = document.createElement('script');
|
|
s.src = 'https://www.google-analytics.com/analytics.js';
|
|
document.head!.appendChild(s);
|
|
}
|