• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / 2a75273d-ba0f-41a1-9fbe-94f2c32dbd6e

pending completion
2a75273d-ba0f-41a1-9fbe-94f2c32dbd6e

push

circleci

Vincent
Add type definition for FxA account data

282 of 1655 branches covered (17.04%)

Branch coverage included in aggregate %.

959 of 4493 relevant lines covered (21.34%)

3.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/views/guestLayout.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import AppConstants from '../app-constants.js'
6
import { getMessage, getLocale } from '../utils/fluent.js'
7

8
/**
9
 * @type {ViewPartial<GuestViewPartialData<any>>}
10
 */
11
const guestLayout = data => `
×
12
<!doctype html>
13
<html lang=${getLocale()}>
14
  <head>
15
    <title>${getMessage('brand-fx-monitor')}</title>
16
    <style>html {display: none;}</style>
17

18
    <meta charset='utf-8'>
19
    <meta name='viewport' content='width=320, initial-scale=1'>
20
    <meta name='description' content='${getMessage('meta-desc')}'>
21
    <meta name='twitter:card' content='summary_large_image'>
22
    <meta name='twitter:title' content='${getMessage('brand-fx-monitor')}'>
23
    <meta name='twitter:description' content='${getMessage('meta-desc')}'>
24
    <meta name='twitter:image' content='${AppConstants.SERVER_URL}/images/og-image.webp'>
25
    <meta property='og:title' content='${getMessage('brand-fx-monitor')}'>
26
    <meta property='og:description' content='${getMessage('meta-desc')}'>
27
    <meta property='og:site_name' content='${getMessage('brand-fx-monitor')}'>
28
    <meta property='og:type' content='website'>
29
    <meta property='og:url' content='${AppConstants.SERVER_URL}'>
30
    <meta property='og:image' content='${AppConstants.SERVER_URL}/images/og-image.webp'>
31

32
    <link rel='preload' href='/fonts/Metropolis-Bold.woff2' as='font' type='font/woff2' crossorigin>
33
    <link rel='preload' href='/fonts/Inter-Regular-latin.woff2' as='font' type='font/woff2' crossorigin>
34
    <link rel='stylesheet' href='/css/index.css' type='text/css'>
35
    <link rel='stylesheet' href='/css/partials/${data.partial.name}.css' type='text/css'>
36
    <link rel='icon' href='/images/favicon-16.webp' sizes='16x16'>
37
    <link rel='icon' href='/images/favicon-32.webp' sizes='32x32'>
38
    <link rel='icon' href='/images/favicon-48.webp' sizes='48x48'>
39
    <link rel='icon' href='/images/favicon-96.webp' sizes='96x96'>
40
    <link rel='icon' href='/images/favicon-144.webp' sizes='144x144'>
41
    <link rel='icon' href='/images/favicon-256.webp' sizes='256x256'>
42
    <link rel='apple-touch-icon' href='/images/apple-touch-icon.webp' sizes='180x180'>
43

44
    <script src='/js/index.js' type='module'></script>
45

46
    <!-- Google tag (gtag.js) -->
47
    <script nonce='${data.nonce}'>
48
      if (!navigator.doNotTrack || navigator.doNotTrack !== '1') {
49
        (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
50
        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
51
        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
52
        'https://www.googletagmanager.com/gtag/js?id='+i+dl;var n=d.querySelector('[nonce]');
53
        n&&j.setAttribute('nonce',n.nonce||n.getAttribute('nonce'));f.parentNode.insertBefore(j,f);
54
        })(window,document,'script','dataLayer','${AppConstants.GA4_MEASUREMENT_ID}');
55
        function gtag(){dataLayer.push(arguments);}
56
        gtag('js', new Date());
57
        gtag('config', '${AppConstants.GA4_MEASUREMENT_ID}', {
58
          cookie_domain: window.location.hostname,
59
          cookie_flags: "SameSite=None;Secure",
60
          debug_mode: ${Boolean(AppConstants.GA4_DEBUG_MODE)}
61
        });
62
        window.gtag = gtag
63

64
        // Detect CTA clicks on public pages.
65
        document.querySelectorAll('[data-cta-id]').forEach(a =>
66
          a.addEventListener('click', e => {
67
            gtag('event', 'clicked_cta', { cta_id: a.dataset.ctaId })
68
          })
69
        )
70
      } else {
71
        function gtag() {
72
          console.debug("Google Analytics disbled by DNT")
73
      }
74
      </script>
75
    <!-- End Google tag (gtag.js) -->
76

77
  </head>
78
  <body>
79
    <header>
80
      <a href='/'>
81
        <img class='monitor-logo' srcset='/images/monitor-logo-transparent.webp 213w, /images/monitor-logo-transparent@2x.webp 425w' width='213' height='33' alt='${getMessage('brand-fx-monitor')}'>
82
      </a>
83
      <menu>
84
        <li><a href='/user/breaches' data-cta-id='sign-in-1' class='button secondary'>${getMessage('sign-in')}</a></li>
85
      </menu>
86
    </header>
87
    <main data-partial='${data.partial.name}'>
88
      ${data.partial(data)}
89
    </main>
90
    <footer class='site-footer'>
91
      <a href='https://www.mozilla.org' target='_blank'>
92
        <img src='/images/moz-logo-1color-white-rgb-01.svg' width='100' height='29' loading='lazy' alt='${getMessage('mozilla')}'>
93
      </a>
94
      <menu>
95
        <li><a href='/breaches'>${getMessage('footer-nav-all-breaches')}</a></li>
96
        <li><a href='https://support.mozilla.org/kb/firefox-monitor-faq' target='_blank'>FAQ</a></li>
97
        <li><a href='https://www.mozilla.org/privacy/firefox-monitor' target='_blank'>${getMessage('terms-and-privacy')}</a></li>
98
        <li><a href='https://github.com/mozilla/blurts-server' target='_blank'>${getMessage('github')}</a></li>
99
      </menu>
100
    </footer>
101
  </body>
102
</html>
103
`
104

105
export { guestLayout }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc