From 2c60c703b43103f33deab6a187e16d12646560d9 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Tue, 15 Jun 2021 14:56:46 +0100 Subject: [PATCH] Add failsafe success signal Former-commit-id: 004fc17a68c906b6890fc28a2d094a70d83910bd [formerly 7679bb250083407fa3f350633e34ed651e222143 [formerly 720b7634cc6353997ef826720f5255f84f24980b]] Former-commit-id: 9b43520e7edf9c894ca5fc9751781bbed3c18169 Former-commit-id: 2fcc53f2d5207f8bbe318c6dad3fc0a5ac851075 --- www/js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/js/app.js b/www/js/app.js index 14103fc2..971fdde4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -60,6 +60,12 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett cache.test(function(){}); // Unique identifier of the article expected to be displayed var expectedArticleURLToBeDisplayed = ""; + // Check if we have managed to switch to PWA mode (if running UWP app) + // DEV: we do this in init.js, but sometimes it doesn't seem to register, so we do it again once the app has fully launched + if (/UWP\|PWA/.test(params.appType) && /^http/i.test(window.location.protocol)) { + // We are in a PWA, so signal success + params.localUWPSettings.PWA_launch = 'success'; + } /** * Resize the IFrame height, so that it fills the whole available height in the window