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

mozilla / blurts-server / 4d55396b-0a59-42cf-a137-42ac53c818f7

pending completion
4d55396b-0a59-42cf-a137-42ac53c818f7

Pull #2968

circleci

Vincent
Allow scanning for exposures without logging in
Pull Request #2968: Allow scanning for exposures without logging in

282 of 1653 branches covered (17.06%)

Branch coverage included in aggregate %.

107 of 107 new or added lines in 9 files covered. (100.0%)

959 of 4482 relevant lines covered (21.4%)

3.57 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
 * @template {object} PartialParameters
10
 * @param {ViewPartialData<PartialParameters>} data
11
 * @returns {string}
12
 */
13
const guestLayout = data => `
×
14
<!doctype html>
15
<html lang=${getLocale()}>
16
  <head>
17
    <title>${getMessage('brand-fx-monitor')}</title>
18
    <style>html {display: none;}</style>
19

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

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

46
    <script src='/js/index.js' type='module'></script>
47

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

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

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

107
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

© 2025 Coveralls, Inc