/*
 * Beamer Viewer, a web-based PDF presentation viewer
 * Copyright 2018-2024 Pacien TRAN-GIRARD
 * SPDX-License-Identifier: EUPL-1.2
 */

"use strict";

function isController() {
  return window.opener == null || window.opener.location.href != window.location.href;
}

function initCache() {
  if (!navigator.serviceWorker) return;
  navigator.serviceWorker.register("appcache.js");
  
  const offlineCapableIndicator = document.getElementById("offlineCapable");
  offlineCapableIndicator.style.visibility = "visible";
}

function init() {
  initCache();
  const viewer = new Viewer();
}

if (isController())
  init();