PageSourceSearch

https://pasha2.co.uk/assets/js/ath.js?1788984704

js pasha2.co.uk collected 2026-09-24 15:13:54 UTC 986 bytes, 32 lines download raw bytes

1// Add support for add to home screen
2$(window).on('load', async function() {
3  if (window.AddToHomeScreen) {
4    const response = await fetch($('#manifest').attr('href'));
5    const manifest = await response.json();
6
7    // Get icon
8    const appIconUrl = (manifest?.icons ?? []).filter(icon => {
9      return icon.sizes === '192x192';
10    })?.[0]?.['src'] ?? '';
11
12    window.AddToHomeScreenInstance = window.AddToHomeScreen({
13      appName: manifest?.name ?? '',
14      appNameDisplay: 'inline',
15      appIconUrl,
16      assetUrl: '/assets/js/ath/assets/',
17    });
18
19    const isMobile = window.AddToHomeScreenInstance.isDeviceIOS() ||
20        window.AddToHomeScreenInstance.isDeviceAndroid();
21
22    if(isMobile && !window.AddToHomeScreenInstance.isStandAlone()) {
23      $('body').removeClass('promo-is-hidden');
24    }
25
26    $('#promo img').attr('src', appIconUrl);
27
28    $(document).on('click', '#add-to-home', function() {
29      window.AddToHomeScreenInstance.show('en');
30    });
31  }
32});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.