tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

OnboardingMessageProvider.sys.mjs (114330B)


      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 // We use importESModule here instead of static import so that
      6 // the Karma test environment won't choke on this module. This
      7 // is because the Karma test environment already stubs out
      8 // XPCOMUtils and AppConstants, and overrides importESModule
      9 // to be a no-op (which can't be done for a static import statement).
     10 
     11 // eslint-disable-next-line mozilla/use-static-import
     12 const { XPCOMUtils } = ChromeUtils.importESModule(
     13  "resource://gre/modules/XPCOMUtils.sys.mjs"
     14 );
     15 
     16 // eslint-disable-next-line mozilla/use-static-import
     17 const { AppConstants } = ChromeUtils.importESModule(
     18  "resource://gre/modules/AppConstants.sys.mjs"
     19 );
     20 
     21 import { FeatureCalloutMessages } from "resource:///modules/asrouter/FeatureCalloutMessages.sys.mjs";
     22 
     23 const lazy = {};
     24 
     25 ChromeUtils.defineESModuleGetters(lazy, {
     26  BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
     27  ShellService: "moz-src:///browser/components/shell/ShellService.sys.mjs",
     28 });
     29 
     30 XPCOMUtils.defineLazyPreferenceGetter(
     31  lazy,
     32  "usesFirefoxSync",
     33  "services.sync.username"
     34 );
     35 
     36 XPCOMUtils.defineLazyPreferenceGetter(
     37  lazy,
     38  "mobileDevices",
     39  "services.sync.clients.devices.mobile",
     40  0
     41 );
     42 
     43 XPCOMUtils.defineLazyPreferenceGetter(
     44  lazy,
     45  "hidePrivatePin",
     46  "browser.startup.upgradeDialog.pinPBM.disabled",
     47  false
     48 );
     49 
     50 const L10N = new Localization([
     51  "branding/brand.ftl",
     52  "browser/newtab/onboarding.ftl",
     53  "toolkit/branding/brandings.ftl",
     54 ]);
     55 
     56 const HOMEPAGE_PREF = "browser.startup.homepage";
     57 const NEWTAB_PREF = "browser.newtabpage.enabled";
     58 const FOURTEEN_DAYS_IN_MS = 14 * 24 * 60 * 60 * 1000;
     59 const isMSIX =
     60  AppConstants.platform === "win" &&
     61  Services.sysinfo.getProperty("hasWinPackageId", false);
     62 
     63 const BASE_MESSAGES = () => [
     64  {
     65    id: "BROWSER_BACKUP_OPTIN_SPOTLIGHT",
     66    groups: ["win10-eos-sync", "eco"],
     67    // TODO: The backup preferences in this expression should be updated once BackupService exposes getters; see Bug 1993272
     68    targeting:
     69      "source == 'newtab' && os.isWindows && os.windowsVersion == 10 && os.windowsBuildNumber <= 19045 && isFxAEnabled && !isFxASignedIn && !hasSelectableProfiles && !hasActiveEnterprisePolicies && backupArchiveEnabled && (!'browser.backup.scheduled.enabled' | preferenceValue) && (!'browser.backup.scheduled.user-disabled' | preferenceValue) && !isMajorUpgrade && !willShowDefaultPrompt && !activeNotifications && previousSessionEnd && 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features' | preferenceValue != false",
     70    trigger: {
     71      id: "defaultBrowserCheck",
     72    },
     73    template: "spotlight",
     74    priority: 5,
     75    frequency: {
     76      lifetime: 1,
     77    },
     78    content: {
     79      id: "BROWSER_BACKUP_OPTIN_SPOTLIGHT",
     80      template: "multistage",
     81      modal: "tab",
     82      transitions: true,
     83      screens: [
     84        {
     85          id: "SCREEN_1",
     86          force_hide_steps_indicator: true,
     87          content: {
     88            position: "center",
     89            screen_style: {
     90              width: "650px",
     91              height: "500px",
     92            },
     93            split_content_padding_block: "32px",
     94            title: {
     95              string_id: "create-backup-screen-1-title",
     96              letterSpacing: "revert",
     97              whiteSpace: "preserve-breaks",
     98              lineHeight: "28px",
     99              marginBlock: "0",
    100            },
    101            subtitle: {
    102              string_id: "create-backup-screen-1-subtitle",
    103              fontSize: "0.8125em",
    104              letterSpacing: "revert",
    105              marginBlock: "12px 0",
    106            },
    107            cta_paragraph: {
    108              text: {
    109                string_id: "create-backup-learn-more-link",
    110                string_name: "learn-more-label",
    111                fontSize: "0.8125em",
    112              },
    113              style: {
    114                marginBlock: "0",
    115                lineHeight: "100%",
    116                letterSpacing: "revert",
    117              },
    118              action: {
    119                type: "OPEN_URL",
    120                data: {
    121                  args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/firefox-backup?utm_medium=firefox-desktop&utm_source=spotlight&utm_campaign=fx-backup-onboarding&utm_content=backup-turn-on-scheduled-learn-more-link&utm_term=fx-backup-onboarding-spotlight-1",
    122                  where: "tabshifted",
    123                },
    124              },
    125            },
    126            tiles: {
    127              type: "single-select",
    128              autoTrigger: false,
    129              selected: "sync",
    130              action: {
    131                picker: "<event>",
    132              },
    133              data: [
    134                {
    135                  inert: true,
    136                  type: "backup",
    137                  icon: {
    138                    background:
    139                      "center / contain no-repeat url('https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/733144c8-a453-49eb-aff7-27a10786fbc1.svg')",
    140                    width: "133.9601px",
    141                    height: "90.1186px",
    142                    marginBlockStart: "8px",
    143                    borderRadius: "5px",
    144                  },
    145                  id: "sync",
    146                  flair: {
    147                    centered: true,
    148                    text: {
    149                      string_id: "create-backup-screen-1-flair",
    150                      fontSize: "0.625em",
    151                      fontWeight: "600",
    152                      top: "revert",
    153                      lineHeight: "normal",
    154                    },
    155                  },
    156                  label: {
    157                    string_id: "create-backup-screen-1-sync-label",
    158                    fontSize: 17,
    159                    fontWeight: 600,
    160                  },
    161                  body: {
    162                    string_id: "create-backup-screen-1-sync-body",
    163                    fontSize: "0.625em",
    164                    fontWeight: "400",
    165                    marginBlock: "-6px 16px",
    166                    color: "var(--text-color-deemphasized)",
    167                  },
    168                  tilebutton: {
    169                    label: {
    170                      string_id: "create-backup-select-tile-button-label",
    171                      minHeight: "24px",
    172                      minWidth: "revert",
    173                      lineHeight: "100%",
    174                      paddingBlock: "4px",
    175                      paddingInline: "16px",
    176                      marginBlock: "0 16px",
    177                    },
    178                    style: "primary",
    179                    action: {
    180                      type: "FXA_SIGNIN_FLOW",
    181                      dismiss: "actionResult",
    182                      needsAwait: true,
    183                      data: {
    184                        autoClose: false,
    185                        entrypoint: "spotlight-create-backup",
    186                        extraParams: {
    187                          service: "sync",
    188                          entrypoint_experiment: "fx-backup-onboarding",
    189                          entrypoint_variation: "1",
    190                          utm_medium: "firefox-desktop",
    191                          utm_source: "spotlight",
    192                          utm_campaign: "fx-backup-onboarding",
    193                          utm_term: "fx-backup-onboarding-spotlight-1",
    194                        },
    195                      },
    196                    },
    197                  },
    198                },
    199                {
    200                  inert: true,
    201                  type: "backup",
    202                  icon: {
    203                    background:
    204                      "center / contain no-repeat url('https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/112b3d3c-5f6b-42c1-b56b-c70b08a6e4ad.svg')",
    205                    width: "114.475px",
    206                    height: "90.1186px",
    207                    marginBlockStart: "8px",
    208                    borderRadius: "5px",
    209                  },
    210                  id: "backup",
    211                  flair: {
    212                    centered: true,
    213                    spacer: true,
    214                  },
    215                  label: {
    216                    string_id: "create-backup-screen-1-backup-label",
    217                    fontSize: 17,
    218                    fontWeight: 600,
    219                  },
    220                  body: {
    221                    string_id: "create-backup-screen-1-backup-body",
    222                    fontSize: "0.625em",
    223                    fontWeight: "400",
    224                    marginBlock: "-6px 16px",
    225                    color: "var(--text-color-deemphasized)",
    226                  },
    227                  tilebutton: {
    228                    label: {
    229                      string_id: "create-backup-select-tile-button-label",
    230                      minHeight: "24px",
    231                      minWidth: "revert",
    232                      lineHeight: "100%",
    233                      paddingBlock: "4px",
    234                      paddingInline: "16px",
    235                      marginBlock: "0 16px",
    236                    },
    237                    style: "secondary",
    238                    action: {
    239                      navigate: true,
    240                    },
    241                  },
    242                },
    243              ],
    244            },
    245            additional_button: {
    246              label: {
    247                string_id: "fx-view-discoverability-secondary-button-label",
    248                fontSize: "0.75em",
    249                minHeight: "24px",
    250                minWidth: "revert",
    251                lineHeight: "100%",
    252                paddingBlock: "4px",
    253                paddingInline: "12px",
    254              },
    255              style: "secondary",
    256              flow: "row",
    257              action: {
    258                type: "BLOCK_MESSAGE",
    259                data: {
    260                  id: "BROWSER_BACKUP_OPTIN_SPOTLIGHT",
    261                },
    262                dismiss: true,
    263              },
    264            },
    265            submenu_button: {
    266              label: {
    267                minHeight: "24px",
    268                minWidth: "24px",
    269                paddingBlock: "0",
    270                paddingInline: "0",
    271              },
    272              submenu: [
    273                {
    274                  type: "action",
    275                  label: { string_id: "create-backup-show-fewer" },
    276                  action: {
    277                    type: "MULTI_ACTION",
    278                    dismiss: true,
    279                    data: {
    280                      actions: [
    281                        {
    282                          type: "SET_PREF",
    283                          data: {
    284                            pref: {
    285                              name: "messaging-system-action.show-fewer-backup-messages",
    286                              value: true,
    287                            },
    288                          },
    289                        },
    290                        {
    291                          type: "BLOCK_MESSAGE",
    292                          data: {
    293                            id: "BROWSER_BACKUP_OPTIN_SPOTLIGHT",
    294                          },
    295                        },
    296                      ],
    297                    },
    298                  },
    299                  id: "show_fewer_recommendations",
    300                },
    301              ],
    302              attached_to: "additional_button",
    303            },
    304          },
    305        },
    306        {
    307          id: "SCREEN_2",
    308          force_hide_steps_indicator: true,
    309          content: {
    310            position: "center",
    311            screen_style: {
    312              width: "650px",
    313              height: "560px",
    314            },
    315            split_content_padding_block: "32px",
    316            title: {
    317              string_id: "create-backup-screen-2-title",
    318              letterSpacing: "revert",
    319              lineHeight: "28px",
    320              marginBlock: "0",
    321            },
    322            subtitle: {
    323              string_id: "create-backup-screen-2-subtitle",
    324              fontSize: "0.8125em",
    325              letterSpacing: "revert",
    326              marginBlock: "8px 0",
    327            },
    328            tiles: {
    329              type: "single-select",
    330              selected: "all",
    331              action: {
    332                picker: "<event>",
    333              },
    334              data: [
    335                {
    336                  inert: true,
    337                  type: "backup",
    338                  icon: {
    339                    background:
    340                      "center / contain no-repeat url('https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/1741e2ae-2423-4b74-9f3b-b22dcd48d3b3.svg')",
    341                    width: "54px",
    342                    height: "54px",
    343                    marginBlockStart: "22px",
    344                    borderRadius: "5px",
    345                  },
    346                  id: "easy",
    347                  label: {
    348                    string_id: "create-backup-screen-2-easy-label",
    349                    fontSize: 17,
    350                    fontWeight: 600,
    351                    marginBlock: "3px 10px",
    352                  },
    353                  body: {
    354                    items: [
    355                      {
    356                        icon: {
    357                          background:
    358                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    359                          height: "18px",
    360                          width: "18px",
    361                        },
    362                        text: {
    363                          string_id: "create-backup-screen-2-easy-list-1",
    364                          marginBlock: "4px",
    365                          fontSize: "13px",
    366                        },
    367                      },
    368                      {
    369                        icon: {
    370                          background:
    371                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/close-16.svg')",
    372                          height: "18px",
    373                          width: "18px",
    374                        },
    375                        text: {
    376                          string_id: "create-backup-screen-2-easy-list-2",
    377                          marginBlock: "4px",
    378                          fontSize: "13px",
    379                        },
    380                      },
    381                      {
    382                        icon: {
    383                          background:
    384                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/close-16.svg')",
    385                          height: "18px",
    386                          width: "18px",
    387                        },
    388                        text: {
    389                          string_id: "create-backup-screen-2-easy-list-3",
    390                          marginBlock: "4px",
    391                          fontSize: "13px",
    392                          fontWeight: "600",
    393                        },
    394                      },
    395                    ],
    396                  },
    397                  tilebutton: {
    398                    label: {
    399                      string_id: "create-backup-select-tile-button-label",
    400                      minHeight: "24px",
    401                      minWidth: "revert",
    402                      lineHeight: "100%",
    403                      paddingBlock: "4px",
    404                      paddingInline: "16px",
    405                      marginBlock: "0 16px",
    406                    },
    407                    style: "primary",
    408                    action: {
    409                      type: "SET_PREF",
    410                      navigate: true,
    411                      data: {
    412                        pref: {
    413                          name: "messaging-system-action.backupChooser",
    414                          value: "easy",
    415                        },
    416                      },
    417                    },
    418                  },
    419                },
    420                {
    421                  inert: true,
    422                  type: "backup",
    423                  icon: {
    424                    background:
    425                      "center / contain no-repeat url('https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/0ddfd632-b9c4-45d6-86c3-b89f94797110.svg')",
    426                    width: "54px",
    427                    height: "54px",
    428                    marginBlockStart: "22px",
    429                    borderRadius: "5px",
    430                  },
    431                  id: "all",
    432                  label: {
    433                    string_id: "create-backup-screen-2-all-label",
    434                    fontSize: 17,
    435                    fontWeight: 600,
    436                    marginBlock: "3px 10px",
    437                  },
    438                  body: {
    439                    items: [
    440                      {
    441                        icon: {
    442                          background:
    443                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    444                          height: "18px",
    445                          width: "18px",
    446                        },
    447                        text: {
    448                          string_id: "create-backup-screen-2-easy-list-1",
    449                          marginBlock: "4px",
    450                          fontSize: "13px",
    451                        },
    452                      },
    453                      {
    454                        icon: {
    455                          background:
    456                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    457                          height: "18px",
    458                          width: "18px",
    459                        },
    460                        text: {
    461                          string_id: "create-backup-screen-2-all-list-2",
    462                          marginBlock: "4px",
    463                          fontSize: "13px",
    464                        },
    465                      },
    466                      {
    467                        icon: {
    468                          background:
    469                            "center / contain no-repeat url('chrome://browser/content/asrouter/assets/shield-checkmark-16.svg')",
    470                          height: "18px",
    471                          width: "18px",
    472                        },
    473                        text: {
    474                          string_id: "create-backup-screen-2-all-list-3",
    475                          marginBlock: "4px",
    476                          fontSize: "13px",
    477                          fontWeight: "600",
    478                        },
    479                      },
    480                    ],
    481                  },
    482                  tilebutton: {
    483                    label: {
    484                      string_id: "create-backup-select-tile-button-label",
    485                      minHeight: "24px",
    486                      minWidth: "revert",
    487                      lineHeight: "100%",
    488                      paddingBlock: "4px",
    489                      paddingInline: "16px",
    490                      marginBlock: "0 16px",
    491                    },
    492                    marginBlock: "0 16px",
    493                    style: "primary",
    494                    action: {
    495                      type: "SET_PREF",
    496                      navigate: true,
    497                      data: {
    498                        pref: {
    499                          name: "messaging-system-action.backupChooser",
    500                          value: "full",
    501                        },
    502                      },
    503                    },
    504                  },
    505                },
    506              ],
    507            },
    508            additional_button: {
    509              style: "secondary",
    510              label: {
    511                string_id: "create-backup-back-button-label",
    512                fontSize: "0.75em",
    513                minHeight: "24px",
    514                minWidth: "revert",
    515                lineHeight: "100%",
    516                paddingBlock: "4px",
    517                paddingInline: "12px",
    518              },
    519              action: {
    520                navigate: true,
    521                goBack: true,
    522              },
    523            },
    524          },
    525        },
    526        {
    527          id: "SCREEN_3A",
    528          force_hide_steps_indicator: true,
    529          targeting: "!isEncryptedBackup",
    530          content: {
    531            logo: {
    532              imageURL:
    533                "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/0706f067-eaf8-4537-a9e1-6098d990f511.svg",
    534              height: "110px",
    535            },
    536            title: {
    537              string_id: "create-backup-screen-3-location",
    538              paddingBlock: "8px",
    539              fontSize: "24px",
    540              fontWeight: 600,
    541            },
    542            isEncryptedBackup: false,
    543            screen_style: {
    544              width: "650px",
    545              height: "600px",
    546            },
    547            tiles: {
    548              type: "fx_backup_file_path",
    549              options: {
    550                hide_password_input: true,
    551                file_path_label: "fx-backup-opt-in-filepath-label",
    552                turn_on_backup_header: "fx-backup-opt-in-header",
    553                turn_on_backup_confirm_btn_label:
    554                  "fx-backup-opt-in-confirm-btn-label",
    555              },
    556            },
    557            additional_button: {
    558              style: "secondary",
    559              label: {
    560                string_id: "create-backup-back-button-label",
    561                fontSize: "0.75em",
    562                minHeight: "24px",
    563                minWidth: "revert",
    564                lineHeight: "100%",
    565                paddingBlock: "4px",
    566                paddingInline: "12px",
    567              },
    568              action: {
    569                navigate: true,
    570                goBack: true,
    571              },
    572            },
    573          },
    574        },
    575        {
    576          id: "SCREEN_3B",
    577          force_hide_steps_indicator: true,
    578          targeting: "isEncryptedBackup",
    579          content: {
    580            isEncryptedBackup: true,
    581            logo: {
    582              imageURL:
    583                "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/0706f067-eaf8-4537-a9e1-6098d990f511.svg",
    584              height: "110px",
    585            },
    586            title: {
    587              string_id: "create-backup-screen-3-location",
    588            },
    589            screen_style: {
    590              width: "650px",
    591              height: "600px",
    592            },
    593            tiles: {
    594              type: "fx_backup_file_path",
    595              options: {
    596                hide_password_input: true,
    597                hide_secondary_button: true,
    598                file_path_label: "fx-backup-opt-in-filepath-label",
    599                turn_on_backup_header: "fx-backup-opt-in-header",
    600                turn_on_backup_confirm_btn_label:
    601                  "fx-backup-opt-in-confirm-btn-label",
    602              },
    603            },
    604            additional_button: {
    605              style: "secondary",
    606              flow: "row",
    607              label: {
    608                string_id: "create-backup-back-button-label",
    609                fontSize: "0.75em",
    610                minHeight: "24px",
    611                minWidth: "revert",
    612                lineHeight: "100%",
    613                paddingBlock: "4px",
    614                paddingInline: "12px",
    615              },
    616              action: {
    617                navigate: true,
    618                goBack: true,
    619              },
    620            },
    621          },
    622        },
    623        {
    624          id: "FX_BACKUP_ENCRYPTION",
    625          force_hide_steps_indicator: true,
    626          targeting: "isEncryptedBackup",
    627          content: {
    628            isEncryptedBackup: true,
    629            title: {
    630              string_id: "create-backup-screen-3-title",
    631            },
    632            subtitle: {
    633              string_id: "create-backup-screen-3-subtitle",
    634              fontSize: "13px",
    635            },
    636            screen_style: {
    637              width: "700px",
    638              height: "650px",
    639            },
    640            logo: {
    641              imageURL:
    642                "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/0fb332a4-6b15-4d6e-bbd5-0558ac3e004f.svg",
    643              height: "130px",
    644            },
    645            tiles: {
    646              type: "fx_backup_password",
    647              options: {
    648                hide_secondary_button: true,
    649                create_password_label: "fx-backup-opt-in-create-password-label",
    650                turn_on_backup_confirm_btn_label:
    651                  "fx-backup-opt-in-confirm-btn-label",
    652              },
    653            },
    654            additional_button: {
    655              style: "secondary",
    656              label: {
    657                string_id: "create-backup-back-button-label",
    658                fontSize: "0.75em",
    659                minHeight: "24px",
    660                minWidth: "revert",
    661                lineHeight: "100%",
    662                paddingBlock: "4px",
    663                paddingInline: "12px",
    664              },
    665              action: {
    666                navigate: true,
    667                goBack: true,
    668              },
    669            },
    670          },
    671        },
    672        {
    673          id: "BACKUP_CONFIRMATION_SCREEN_EASY",
    674          force_hide_steps_indicator: true,
    675          targeting: "!isEncryptedBackup",
    676          content: {
    677            screen_style: {
    678              width: "664px",
    679              height: "580px",
    680            },
    681            logo: {
    682              imageURL:
    683                "chrome://browser/content/asrouter/assets/fox-with-checkmark.svg",
    684              height: "96px",
    685            },
    686            title: {
    687              string_id: "fx-backup-confirmation-screen-title",
    688            },
    689            tiles: {
    690              type: "confirmation-checklist",
    691              data: {
    692                inert: true,
    693                style: { width: "500px" },
    694                items: [
    695                  {
    696                    icon: {
    697                      background:
    698                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    699                      height: "18px",
    700                      width: "18px",
    701                    },
    702                    text: {
    703                      string_id:
    704                        "fx-backup-confirmation-screen-easy-setup-item-text-1",
    705                      fontWeight: "600",
    706                    },
    707                    subtext: {
    708                      string_id: "fx-backup-confirmation-screen-item-subtext-1",
    709                    },
    710                    link_keys: ["settings"],
    711                  },
    712                  {
    713                    icon: {
    714                      background:
    715                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    716                      height: "18px",
    717                      width: "18px",
    718                    },
    719                    text: {
    720                      string_id:
    721                        "fx-backup-confirmation-screen-easy-setup-item-text-2",
    722                      fontWeight: "600",
    723                    },
    724                    subtext: {
    725                      string_id: "fx-backup-confirmation-screen-item-subtext-2",
    726                    },
    727                  },
    728                  {
    729                    icon: {
    730                      background:
    731                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/subtract-16.svg')",
    732                      height: "18px",
    733                      width: "18px",
    734                    },
    735                    text: {
    736                      string_id:
    737                        "fx-backup-confirmation-screen-easy-setup-item-text-3",
    738                      fontWeight: "600",
    739                    },
    740                    subtext: {
    741                      string_id:
    742                        "fx-backup-confirmation-screen-easy-setup-item-subtext-3",
    743                    },
    744                    link_keys: ["settings"],
    745                  },
    746                ],
    747              },
    748            },
    749            settings: {
    750              action: {
    751                type: "OPEN_ABOUT_PAGE",
    752                data: {
    753                  args: "preferences#sync-backup",
    754                  where: "tab",
    755                },
    756                dismiss: true,
    757              },
    758            },
    759            additional_button: {
    760              label: {
    761                string_id: "fx-backup-confirmation-screen-close-button",
    762                fontSize: "0.75em",
    763                minHeight: "24px",
    764                minWidth: "revert",
    765                lineHeight: "100%",
    766                paddingBlock: "4px",
    767                paddingInline: "12px",
    768              },
    769              style: "secondary",
    770              action: { dismiss: true },
    771            },
    772          },
    773        },
    774        {
    775          id: "BACKUP_CONFIRMATION_SCREEN_ENCRYPTED",
    776          force_hide_steps_indicator: true,
    777          targeting: "isEncryptedBackup",
    778          content: {
    779            isEncryptedBackup: true,
    780            screen_style: {
    781              width: "664px",
    782              height: "580px",
    783            },
    784            logo: {
    785              imageURL:
    786                "chrome://browser/content/asrouter/assets/fox-with-checkmark.svg",
    787              height: "96px",
    788            },
    789            title: {
    790              string_id: "fx-backup-confirmation-screen-title",
    791            },
    792            tiles: {
    793              type: "confirmation-checklist",
    794              data: {
    795                inert: true,
    796                style: { width: "500px" },
    797                items: [
    798                  {
    799                    icon: {
    800                      background:
    801                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    802                      height: "18px",
    803                      width: "18px",
    804                    },
    805                    text: {
    806                      string_id:
    807                        "fx-backup-confirmation-screen-all-data-item-text-1",
    808                      fontWeight: "600",
    809                    },
    810                    subtext: {
    811                      string_id: "fx-backup-confirmation-screen-item-subtext-1",
    812                    },
    813                    link_keys: ["settings"],
    814                  },
    815                  {
    816                    icon: {
    817                      background:
    818                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    819                      height: "18px",
    820                      width: "18px",
    821                    },
    822                    text: {
    823                      string_id:
    824                        "fx-backup-confirmation-screen-all-data-item-text-2",
    825                      fontWeight: "600",
    826                    },
    827                    subtext: {
    828                      string_id: "fx-backup-confirmation-screen-item-subtext-2",
    829                    },
    830                  },
    831                  {
    832                    icon: {
    833                      background:
    834                        "center / contain no-repeat url('chrome://browser/content/asrouter/assets/checkmark-16.svg')",
    835                      height: "18px",
    836                      width: "18px",
    837                    },
    838                    text: {
    839                      string_id:
    840                        "fx-backup-confirmation-screen-all-data-item-text-3",
    841                      fontWeight: "600",
    842                    },
    843                  },
    844                ],
    845              },
    846            },
    847            settings: {
    848              action: {
    849                type: "OPEN_ABOUT_PAGE",
    850                data: {
    851                  args: "preferences#sync-backup",
    852                  where: "tab",
    853                },
    854                dismiss: true,
    855              },
    856            },
    857            additional_button: {
    858              label: {
    859                string_id: "fx-backup-confirmation-screen-close-button",
    860                fontSize: "0.75em",
    861                minHeight: "24px",
    862                minWidth: "revert",
    863                lineHeight: "100%",
    864                paddingBlock: "4px",
    865                paddingInline: "12px",
    866              },
    867              style: "secondary",
    868              action: { dismiss: true },
    869            },
    870          },
    871        },
    872      ],
    873    },
    874  },
    875  {
    876    id: "FXA_ACCOUNTS_BADGE",
    877    template: "toolbar_badge",
    878    content: {
    879      delay: 10000, // delay for 10 seconds
    880      target: "fxa-toolbar-menu-button",
    881    },
    882    targeting: "false",
    883    trigger: { id: "toolbarBadgeUpdate" },
    884  },
    885  {
    886    id: "MILESTONE_MESSAGE_87",
    887    groups: ["cfr"],
    888    content: {
    889      text: "",
    890      layout: "short_message",
    891      buttons: {
    892        primary: {
    893          event: "PROTECTION",
    894          label: {
    895            string_id: "cfr-doorhanger-milestone-ok-button",
    896          },
    897          action: {
    898            type: "OPEN_PROTECTION_REPORT",
    899          },
    900        },
    901        secondary: [
    902          {
    903            event: "DISMISS",
    904            label: {
    905              string_id: "cfr-doorhanger-milestone-close-button",
    906            },
    907            action: {
    908              type: "CANCEL",
    909            },
    910          },
    911        ],
    912      },
    913      category: "cfrFeatures",
    914      anchor_id: "tracking-protection-icon-container",
    915      bucket_id: "CFR_MILESTONE_MESSAGE",
    916      heading_text: {
    917        string_id: "cfr-doorhanger-milestone-heading2",
    918      },
    919      notification_text: "",
    920      skip_address_bar_notifier: true,
    921    },
    922    trigger: {
    923      id: "contentBlocking",
    924      params: ["ContentBlockingMilestone"],
    925    },
    926    template: "milestone_message",
    927    frequency: {
    928      lifetime: 7,
    929    },
    930    targeting: "pageLoad >= 4 && userPrefs.cfrFeatures",
    931  },
    932  {
    933    id: "FX_MR_106_UPGRADE",
    934    template: "spotlight",
    935    targeting: "true",
    936    content: {
    937      template: "multistage",
    938      id: "FX_MR_106_UPGRADE",
    939      transitions: true,
    940      modal: "tab",
    941      screens: [
    942        {
    943          id: "UPGRADE_PIN_FIREFOX",
    944          content: {
    945            position: "split",
    946            split_narrow_bkg_position: "-155px",
    947            image_alt_text: {
    948              string_id: "mr2022-onboarding-pin-image-alt",
    949            },
    950            progress_bar: "true",
    951            background:
    952              "url('chrome://activity-stream/content/data/content/assets/mr-pintaskbar.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
    953            logo: {},
    954            title: {
    955              string_id: "mr2022-onboarding-existing-pin-header",
    956            },
    957            subtitle: {
    958              string_id: "mr2022-onboarding-existing-pin-subtitle",
    959            },
    960            primary_button: {
    961              label: {
    962                string_id: isMSIX
    963                  ? "mr2022-onboarding-pin-primary-button-label-msix"
    964                  : "mr2022-onboarding-pin-primary-button-label",
    965              },
    966              action: {
    967                type: "MULTI_ACTION",
    968                navigate: true,
    969                data: {
    970                  actions: [
    971                    {
    972                      type: "PIN_FIREFOX_TO_TASKBAR",
    973                    },
    974                    {
    975                      type: "PIN_FIREFOX_TO_START_MENU",
    976                    },
    977                  ],
    978                },
    979              },
    980            },
    981            checkbox: {
    982              label: {
    983                string_id: "mr2022-onboarding-existing-pin-checkbox-label",
    984              },
    985              defaultValue: true,
    986              action: {
    987                type: "MULTI_ACTION",
    988                navigate: true,
    989                data: {
    990                  actions: [
    991                    {
    992                      type: "PIN_FIREFOX_TO_TASKBAR",
    993                      data: {
    994                        privatePin: true,
    995                      },
    996                    },
    997                    {
    998                      type: "PIN_FIREFOX_TO_TASKBAR",
    999                    },
   1000                    {
   1001                      type: "PIN_FIREFOX_TO_START_MENU",
   1002                    },
   1003                  ],
   1004                },
   1005              },
   1006            },
   1007            secondary_button: {
   1008              label: {
   1009                string_id: "mr2022-onboarding-secondary-skip-button-label",
   1010              },
   1011              action: {
   1012                navigate: true,
   1013              },
   1014              has_arrow_icon: true,
   1015            },
   1016          },
   1017        },
   1018        {
   1019          id: "UPGRADE_SET_DEFAULT",
   1020          content: {
   1021            position: "split",
   1022            split_narrow_bkg_position: "-60px",
   1023            image_alt_text: {
   1024              string_id: "mr2022-onboarding-default-image-alt",
   1025            },
   1026            progress_bar: "true",
   1027            background:
   1028              "url('chrome://activity-stream/content/data/content/assets/mr-settodefault.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1029            logo: {},
   1030            title: {
   1031              string_id: "mr2022-onboarding-set-default-title",
   1032            },
   1033            subtitle: {
   1034              string_id: "mr2022-onboarding-set-default-subtitle",
   1035            },
   1036            primary_button: {
   1037              label: {
   1038                string_id: "mr2022-onboarding-set-default-primary-button-label",
   1039              },
   1040              action: {
   1041                navigate: true,
   1042                type: "SET_DEFAULT_BROWSER",
   1043              },
   1044            },
   1045            secondary_button: {
   1046              label: {
   1047                string_id: "mr2022-onboarding-secondary-skip-button-label",
   1048              },
   1049              action: {
   1050                navigate: true,
   1051              },
   1052              has_arrow_icon: true,
   1053            },
   1054          },
   1055        },
   1056        {
   1057          id: "UPGRADE_IMPORT_SETTINGS_EMBEDDED",
   1058          content: {
   1059            tiles: { type: "migration-wizard" },
   1060            position: "split",
   1061            split_narrow_bkg_position: "-42px",
   1062            image_alt_text: {
   1063              string_id: "mr2022-onboarding-import-image-alt",
   1064            },
   1065            background:
   1066              "url('chrome://activity-stream/content/data/content/assets/mr-import.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1067            progress_bar: true,
   1068            hide_secondary_section: "responsive",
   1069            migrate_start: {
   1070              action: {},
   1071            },
   1072            migrate_close: {
   1073              action: {
   1074                navigate: true,
   1075              },
   1076            },
   1077            secondary_button: {
   1078              label: {
   1079                string_id: "mr2022-onboarding-secondary-skip-button-label",
   1080              },
   1081              action: {
   1082                navigate: true,
   1083              },
   1084              has_arrow_icon: true,
   1085            },
   1086          },
   1087        },
   1088        {
   1089          id: "UPGRADE_MOBILE_DOWNLOAD",
   1090          content: {
   1091            position: "split",
   1092            split_narrow_bkg_position: "-160px",
   1093            image_alt_text: {
   1094              string_id: "mr2022-onboarding-mobile-download-image-alt",
   1095            },
   1096            background:
   1097              "url('chrome://activity-stream/content/data/content/assets/mr-mobilecrosspromo.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1098            progress_bar: true,
   1099            logo: {},
   1100            title: {
   1101              string_id:
   1102                "onboarding-mobile-download-security-and-privacy-title",
   1103            },
   1104            subtitle: {
   1105              string_id:
   1106                "onboarding-mobile-download-security-and-privacy-subtitle",
   1107            },
   1108            hero_image: {
   1109              url: "chrome://activity-stream/content/data/content/assets/mobile-download-qr-existing-user.svg",
   1110            },
   1111            cta_paragraph: {
   1112              text: {
   1113                string_id: "mr2022-onboarding-mobile-download-cta-text",
   1114                string_name: "download-label",
   1115              },
   1116              action: {
   1117                type: "OPEN_URL",
   1118                data: {
   1119                  args: "https://www.mozilla.org/firefox/mobile/get-app/?utm_medium=firefox-desktop&utm_source=onboarding-modal&utm_campaign=mr2022&utm_content=existing-global",
   1120                  where: "tab",
   1121                },
   1122              },
   1123            },
   1124            secondary_button: {
   1125              label: {
   1126                string_id: "mr2022-onboarding-secondary-skip-button-label",
   1127              },
   1128              action: {
   1129                navigate: true,
   1130              },
   1131              has_arrow_icon: true,
   1132            },
   1133          },
   1134        },
   1135        {
   1136          id: "UPGRADE_PIN_PRIVATE_WINDOW",
   1137          content: {
   1138            position: "split",
   1139            split_narrow_bkg_position: "-100px",
   1140            image_alt_text: {
   1141              string_id: "mr2022-onboarding-pin-private-image-alt",
   1142            },
   1143            progress_bar: "true",
   1144            background:
   1145              "url('chrome://activity-stream/content/data/content/assets/mr-pinprivate.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1146            logo: {},
   1147            title: {
   1148              string_id: "mr2022-upgrade-onboarding-pin-private-window-header",
   1149            },
   1150            subtitle: {
   1151              string_id:
   1152                "mr2022-upgrade-onboarding-pin-private-window-subtitle",
   1153            },
   1154            primary_button: {
   1155              label: {
   1156                string_id:
   1157                  "mr2022-upgrade-onboarding-pin-private-window-primary-button-label",
   1158              },
   1159              action: {
   1160                type: "PIN_FIREFOX_TO_TASKBAR",
   1161                data: {
   1162                  privatePin: true,
   1163                },
   1164                navigate: true,
   1165              },
   1166            },
   1167            secondary_button: {
   1168              label: {
   1169                string_id: "mr2022-onboarding-secondary-skip-button-label",
   1170              },
   1171              action: {
   1172                navigate: true,
   1173              },
   1174              has_arrow_icon: true,
   1175            },
   1176          },
   1177        },
   1178        {
   1179          id: "UPGRADE_DATA_RECOMMENDATION",
   1180          content: {
   1181            position: "split",
   1182            split_narrow_bkg_position: "-80px",
   1183            image_alt_text: {
   1184              string_id: "mr2022-onboarding-privacy-segmentation-image-alt",
   1185            },
   1186            progress_bar: "true",
   1187            background:
   1188              "url('chrome://activity-stream/content/data/content/assets/mr-privacysegmentation.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1189            logo: {},
   1190            title: {
   1191              string_id: "mr2022-onboarding-privacy-segmentation-title",
   1192            },
   1193            subtitle: {
   1194              string_id: "mr2022-onboarding-privacy-segmentation-subtitle",
   1195            },
   1196            cta_paragraph: {
   1197              text: {
   1198                string_id: "mr2022-onboarding-privacy-segmentation-text-cta",
   1199              },
   1200            },
   1201            primary_button: {
   1202              label: {
   1203                string_id:
   1204                  "mr2022-onboarding-privacy-segmentation-button-primary-label",
   1205              },
   1206              action: {
   1207                type: "SET_PREF",
   1208                data: {
   1209                  pref: {
   1210                    name: "browser.dataFeatureRecommendations.enabled",
   1211                    value: true,
   1212                  },
   1213                },
   1214                navigate: true,
   1215              },
   1216            },
   1217            additional_button: {
   1218              label: {
   1219                string_id:
   1220                  "mr2022-onboarding-privacy-segmentation-button-secondary-label",
   1221              },
   1222              style: "secondary",
   1223              action: {
   1224                type: "SET_PREF",
   1225                data: {
   1226                  pref: {
   1227                    name: "browser.dataFeatureRecommendations.enabled",
   1228                    value: false,
   1229                  },
   1230                },
   1231                navigate: true,
   1232              },
   1233            },
   1234          },
   1235        },
   1236        {
   1237          id: "UPGRADE_GRATITUDE",
   1238          content: {
   1239            position: "split",
   1240            progress_bar: "true",
   1241            split_narrow_bkg_position: "-228px",
   1242            image_alt_text: {
   1243              string_id: "mr2022-onboarding-gratitude-image-alt",
   1244            },
   1245            background:
   1246              "url('chrome://activity-stream/content/data/content/assets/mr-gratitude.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1247            logo: {},
   1248            title: {
   1249              string_id: "mr2022-onboarding-gratitude-title",
   1250            },
   1251            subtitle: {
   1252              string_id: "mr2022-onboarding-gratitude-subtitle",
   1253            },
   1254            primary_button: {
   1255              label: {
   1256                string_id: "mr2022-onboarding-gratitude-primary-button-label",
   1257              },
   1258              action: {
   1259                type: "OPEN_FIREFOX_VIEW",
   1260                navigate: true,
   1261              },
   1262            },
   1263            secondary_button: {
   1264              label: {
   1265                string_id: "mr2022-onboarding-gratitude-secondary-button-label",
   1266              },
   1267              action: {
   1268                navigate: true,
   1269              },
   1270            },
   1271          },
   1272        },
   1273      ],
   1274    },
   1275  },
   1276  {
   1277    id: "FX_100_UPGRADE",
   1278    template: "spotlight",
   1279    targeting: "false",
   1280    content: {
   1281      template: "multistage",
   1282      id: "FX_100_UPGRADE",
   1283      transitions: true,
   1284      screens: [
   1285        {
   1286          id: "UPGRADE_PIN_FIREFOX",
   1287          content: {
   1288            logo: {
   1289              imageURL:
   1290                "chrome://activity-stream/content/data/content/assets/heart.webp",
   1291              height: "73px",
   1292            },
   1293            has_noodles: true,
   1294            title: {
   1295              fontSize: "36px",
   1296              string_id: "fx100-upgrade-thanks-header",
   1297            },
   1298            title_style: "fancy shine",
   1299            background:
   1300              "url('chrome://activity-stream/content/data/content/assets/confetti.svg') top / 100% no-repeat var(--background-color-canvas)",
   1301            subtitle: {
   1302              string_id: "fx100-upgrade-thanks-keep-body",
   1303            },
   1304            primary_button: {
   1305              label: {
   1306                string_id: "fx100-thank-you-pin-primary-button-label",
   1307              },
   1308              action: {
   1309                type: "MULTI_ACTION",
   1310                navigate: true,
   1311                data: {
   1312                  actions: [
   1313                    {
   1314                      type: "PIN_FIREFOX_TO_TASKBAR",
   1315                    },
   1316                    {
   1317                      type: "PIN_FIREFOX_TO_START_MENU",
   1318                    },
   1319                  ],
   1320                },
   1321              },
   1322            },
   1323            secondary_button: {
   1324              label: {
   1325                string_id: "onboarding-not-now-button-label",
   1326              },
   1327              action: {
   1328                navigate: true,
   1329              },
   1330            },
   1331          },
   1332        },
   1333      ],
   1334    },
   1335  },
   1336  {
   1337    id: "PB_NEWTAB_FOCUS_PROMO",
   1338    type: "default",
   1339    template: "pb_newtab",
   1340    groups: ["pbNewtab"],
   1341    content: {
   1342      infoBody: "fluent:about-private-browsing-info-description-simplified",
   1343      infoEnabled: true,
   1344      infoIcon: "chrome://global/skin/icons/indicator-private-browsing.svg",
   1345      infoLinkText: "fluent:about-private-browsing-learn-more-link",
   1346      infoTitle: "",
   1347      infoTitleEnabled: false,
   1348      promoEnabled: true,
   1349      promoType: "FOCUS",
   1350      promoHeader: "fluent:about-private-browsing-focus-promo-header-c",
   1351      promoImageLarge: "chrome://browser/content/assets/focus-promo.png",
   1352      promoLinkText: "fluent:about-private-browsing-focus-promo-cta",
   1353      promoLinkType: "button",
   1354      promoSectionStyle: "below-search",
   1355      promoTitle: "fluent:about-private-browsing-focus-promo-text-c",
   1356      promoTitleEnabled: true,
   1357      promoButton: {
   1358        action: {
   1359          type: "SHOW_SPOTLIGHT",
   1360          data: {
   1361            content: {
   1362              id: "FOCUS_PROMO",
   1363              template: "multistage",
   1364              modal: "tab",
   1365              backdrop: "transparent",
   1366              screens: [
   1367                {
   1368                  id: "DEFAULT_MODAL_UI",
   1369                  content: {
   1370                    logo: {
   1371                      imageURL:
   1372                        "chrome://browser/content/assets/focus-logo.svg",
   1373                      height: "48px",
   1374                    },
   1375                    title: {
   1376                      string_id: "spotlight-focus-promo-title",
   1377                    },
   1378                    subtitle: {
   1379                      string_id: "spotlight-focus-promo-subtitle",
   1380                    },
   1381                    dismiss_button: {
   1382                      action: {
   1383                        navigate: true,
   1384                      },
   1385                    },
   1386                    ios: {
   1387                      action: {
   1388                        data: {
   1389                          args: "https://app.adjust.com/167k4ih?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fapps.apple.com%2Fus%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337",
   1390                          where: "tabshifted",
   1391                        },
   1392                        type: "OPEN_URL",
   1393                        navigate: true,
   1394                      },
   1395                    },
   1396                    android: {
   1397                      action: {
   1398                        data: {
   1399                          args: "https://app.adjust.com/167k4ih?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.focus",
   1400                          where: "tabshifted",
   1401                        },
   1402                        type: "OPEN_URL",
   1403                        navigate: true,
   1404                      },
   1405                    },
   1406                    tiles: {
   1407                      type: "mobile_downloads",
   1408                      data: {
   1409                        QR_code: {
   1410                          image_url:
   1411                            "chrome://browser/content/assets/focus-qr-code.svg",
   1412                          alt_text: {
   1413                            string_id: "spotlight-focus-promo-qr-code",
   1414                          },
   1415                        },
   1416                        marketplace_buttons: ["ios", "android"],
   1417                      },
   1418                    },
   1419                  },
   1420                },
   1421              ],
   1422            },
   1423          },
   1424        },
   1425      },
   1426    },
   1427    priority: 2,
   1428    frequency: {
   1429      custom: [
   1430        {
   1431          cap: 3,
   1432          period: 604800000, // Max 3 per week
   1433        },
   1434      ],
   1435      lifetime: 12,
   1436    },
   1437    // Exclude the next 2 messages: 1) Klar for en 2) Klar for de
   1438    targeting:
   1439      "!(region in [ 'DE', 'AT', 'CH'] && localeLanguageCode == 'en') && localeLanguageCode != 'de'",
   1440  },
   1441  {
   1442    id: "PB_NEWTAB_KLAR_PROMO",
   1443    type: "default",
   1444    template: "pb_newtab",
   1445    groups: ["pbNewtab"],
   1446    content: {
   1447      infoBody: "fluent:about-private-browsing-info-description-simplified",
   1448      infoEnabled: true,
   1449      infoIcon: "chrome://global/skin/icons/indicator-private-browsing.svg",
   1450      infoLinkText: "fluent:about-private-browsing-learn-more-link",
   1451      infoTitle: "",
   1452      infoTitleEnabled: false,
   1453      promoEnabled: true,
   1454      promoType: "FOCUS",
   1455      promoHeader: "fluent:about-private-browsing-focus-promo-header-c",
   1456      promoImageLarge: "chrome://browser/content/assets/focus-promo.png",
   1457      promoLinkText: "Download Firefox Klar",
   1458      promoLinkType: "button",
   1459      promoSectionStyle: "below-search",
   1460      promoTitle:
   1461        "Firefox Klar clears your history every time while blocking ads and trackers.",
   1462      promoTitleEnabled: true,
   1463      promoButton: {
   1464        action: {
   1465          type: "SHOW_SPOTLIGHT",
   1466          data: {
   1467            content: {
   1468              id: "KLAR_PROMO",
   1469              template: "multistage",
   1470              modal: "tab",
   1471              backdrop: "transparent",
   1472              screens: [
   1473                {
   1474                  id: "DEFAULT_MODAL_UI",
   1475                  order: 0,
   1476                  content: {
   1477                    logo: {
   1478                      imageURL:
   1479                        "chrome://browser/content/assets/focus-logo.svg",
   1480                      height: "48px",
   1481                    },
   1482                    title: "Get Firefox Klar",
   1483                    subtitle: {
   1484                      string_id: "spotlight-focus-promo-subtitle",
   1485                    },
   1486                    dismiss_button: {
   1487                      action: {
   1488                        navigate: true,
   1489                      },
   1490                    },
   1491                    ios: {
   1492                      action: {
   1493                        data: {
   1494                          args: "https://app.adjust.com/a8bxj8j?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fapps.apple.com%2Fde%2Fapp%2Fklar-by-firefox%2Fid1073435754",
   1495                          where: "tabshifted",
   1496                        },
   1497                        type: "OPEN_URL",
   1498                        navigate: true,
   1499                      },
   1500                    },
   1501                    android: {
   1502                      action: {
   1503                        data: {
   1504                          args: "https://app.adjust.com/a8bxj8j?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.klar",
   1505                          where: "tabshifted",
   1506                        },
   1507                        type: "OPEN_URL",
   1508                        navigate: true,
   1509                      },
   1510                    },
   1511                    tiles: {
   1512                      type: "mobile_downloads",
   1513                      data: {
   1514                        QR_code: {
   1515                          image_url:
   1516                            "chrome://browser/content/assets/klar-qr-code.svg",
   1517                          alt_text: "Scan the QR code to get Firefox Klar",
   1518                        },
   1519                        marketplace_buttons: ["ios", "android"],
   1520                      },
   1521                    },
   1522                  },
   1523                },
   1524              ],
   1525            },
   1526          },
   1527        },
   1528      },
   1529    },
   1530    priority: 2,
   1531    frequency: {
   1532      custom: [
   1533        {
   1534          cap: 3,
   1535          period: 604800000, // Max 3 per week
   1536        },
   1537      ],
   1538      lifetime: 12,
   1539    },
   1540    targeting: "region in [ 'DE', 'AT', 'CH'] && localeLanguageCode == 'en'",
   1541  },
   1542  {
   1543    id: "PB_NEWTAB_KLAR_PROMO_DE",
   1544    type: "default",
   1545    template: "pb_newtab",
   1546    groups: ["pbNewtab"],
   1547    content: {
   1548      infoBody: "fluent:about-private-browsing-info-description-simplified",
   1549      infoEnabled: true,
   1550      infoIcon: "chrome://global/skin/icons/indicator-private-browsing.svg",
   1551      infoLinkText: "fluent:about-private-browsing-learn-more-link",
   1552      infoTitle: "",
   1553      infoTitleEnabled: false,
   1554      promoEnabled: true,
   1555      promoType: "FOCUS",
   1556      promoHeader: "fluent:about-private-browsing-focus-promo-header-c",
   1557      promoImageLarge: "chrome://browser/content/assets/focus-promo.png",
   1558      promoLinkText: "fluent:about-private-browsing-focus-promo-cta",
   1559      promoLinkType: "button",
   1560      promoSectionStyle: "below-search",
   1561      promoTitle: "fluent:about-private-browsing-focus-promo-text-c",
   1562      promoTitleEnabled: true,
   1563      promoButton: {
   1564        action: {
   1565          type: "SHOW_SPOTLIGHT",
   1566          data: {
   1567            content: {
   1568              id: "FOCUS_PROMO",
   1569              template: "multistage",
   1570              modal: "tab",
   1571              backdrop: "transparent",
   1572              screens: [
   1573                {
   1574                  id: "DEFAULT_MODAL_UI",
   1575                  content: {
   1576                    logo: {
   1577                      imageURL:
   1578                        "chrome://browser/content/assets/focus-logo.svg",
   1579                      height: "48px",
   1580                    },
   1581                    title: {
   1582                      string_id: "spotlight-focus-promo-title",
   1583                    },
   1584                    subtitle: {
   1585                      string_id: "spotlight-focus-promo-subtitle",
   1586                    },
   1587                    dismiss_button: {
   1588                      action: {
   1589                        navigate: true,
   1590                      },
   1591                    },
   1592                    ios: {
   1593                      action: {
   1594                        data: {
   1595                          args: "https://app.adjust.com/a8bxj8j?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fapps.apple.com%2Fde%2Fapp%2Fklar-by-firefox%2Fid1073435754",
   1596                          where: "tabshifted",
   1597                        },
   1598                        type: "OPEN_URL",
   1599                        navigate: true,
   1600                      },
   1601                    },
   1602                    android: {
   1603                      action: {
   1604                        data: {
   1605                          args: "https://app.adjust.com/a8bxj8j?campaign=firefox-desktop&adgroup=pb&creative=focus-omc172&redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.klar",
   1606                          where: "tabshifted",
   1607                        },
   1608                        type: "OPEN_URL",
   1609                        navigate: true,
   1610                      },
   1611                    },
   1612                    tiles: {
   1613                      type: "mobile_downloads",
   1614                      data: {
   1615                        QR_code: {
   1616                          image_url:
   1617                            "chrome://browser/content/assets/klar-qr-code.svg",
   1618                          alt_text: {
   1619                            string_id: "spotlight-focus-promo-qr-code",
   1620                          },
   1621                        },
   1622                        marketplace_buttons: ["ios", "android"],
   1623                      },
   1624                    },
   1625                  },
   1626                },
   1627              ],
   1628            },
   1629          },
   1630        },
   1631      },
   1632    },
   1633    priority: 2,
   1634    frequency: {
   1635      custom: [
   1636        {
   1637          cap: 3,
   1638          period: 604800000, // Max 3 per week
   1639        },
   1640      ],
   1641      lifetime: 12,
   1642    },
   1643    targeting: "localeLanguageCode == 'de'",
   1644  },
   1645  {
   1646    id: "PB_NEWTAB_PIN_PROMO",
   1647    template: "pb_newtab",
   1648    type: "default",
   1649    groups: ["pbNewtab"],
   1650    content: {
   1651      infoBody: "fluent:about-private-browsing-info-description-simplified",
   1652      infoEnabled: true,
   1653      infoIcon: "chrome://global/skin/icons/indicator-private-browsing.svg",
   1654      infoLinkText: "fluent:about-private-browsing-learn-more-link",
   1655      infoTitle: "",
   1656      infoTitleEnabled: false,
   1657      promoEnabled: true,
   1658      promoType: "PIN",
   1659      promoHeader: "fluent:about-private-browsing-pin-promo-header",
   1660      promoImageLarge:
   1661        "chrome://browser/content/assets/private-promo-asset.svg",
   1662      promoLinkText: "fluent:about-private-browsing-pin-promo-link-text",
   1663      promoLinkType: "button",
   1664      promoSectionStyle: "below-search",
   1665      promoTitle: "fluent:about-private-browsing-pin-promo-title",
   1666      promoTitleEnabled: true,
   1667      promoButton: {
   1668        action: {
   1669          type: "MULTI_ACTION",
   1670          data: {
   1671            actions: [
   1672              {
   1673                type: "SET_PREF",
   1674                data: {
   1675                  pref: {
   1676                    name: "browser.privateWindowSeparation.enabled",
   1677                    value: true,
   1678                  },
   1679                },
   1680              },
   1681              {
   1682                type: "PIN_FIREFOX_TO_TASKBAR",
   1683                data: {
   1684                  privatePin: true,
   1685                },
   1686              },
   1687              {
   1688                type: "BLOCK_MESSAGE",
   1689                data: {
   1690                  id: "PB_NEWTAB_PIN_PROMO",
   1691                },
   1692              },
   1693              {
   1694                type: "OPEN_ABOUT_PAGE",
   1695                data: { args: "privatebrowsing", where: "current" },
   1696              },
   1697            ],
   1698          },
   1699        },
   1700      },
   1701    },
   1702    priority: 3,
   1703    frequency: {
   1704      custom: [
   1705        {
   1706          cap: 3,
   1707          period: 604800000, // Max 3 per week
   1708        },
   1709      ],
   1710      lifetime: 12,
   1711    },
   1712    targeting: "doesAppNeedPrivatePin",
   1713  },
   1714  {
   1715    id: "PB_NEWTAB_COOKIE_BANNERS_PROMO",
   1716    template: "pb_newtab",
   1717    type: "default",
   1718    groups: ["pbNewtab"],
   1719    content: {
   1720      infoBody: "fluent:about-private-browsing-info-description-simplified",
   1721      infoEnabled: true,
   1722      infoIcon: "chrome://global/skin/icons/indicator-private-browsing.svg",
   1723      infoLinkText: "fluent:about-private-browsing-learn-more-link",
   1724      infoTitle: "",
   1725      infoTitleEnabled: false,
   1726      promoEnabled: true,
   1727      promoType: "COOKIE_BANNERS",
   1728      promoHeader: "fluent:about-private-browsing-cookie-banners-promo-heading",
   1729      promoImageLarge:
   1730        "chrome://browser/content/assets/cookie-banners-begone.svg",
   1731      promoLinkText: "fluent:about-private-browsing-learn-more-link",
   1732      promoLinkType: "link",
   1733      promoSectionStyle: "below-search",
   1734      promoTitle: "fluent:about-private-browsing-cookie-banners-promo-body",
   1735      promoTitleEnabled: true,
   1736      promoButton: {
   1737        action: {
   1738          type: "MULTI_ACTION",
   1739          data: {
   1740            actions: [
   1741              {
   1742                type: "OPEN_URL",
   1743                data: {
   1744                  args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/cookie-banner-reduction",
   1745                  where: "tabshifted",
   1746                },
   1747              },
   1748              {
   1749                type: "BLOCK_MESSAGE",
   1750                data: {
   1751                  id: "PB_NEWTAB_COOKIE_BANNERS_PROMO",
   1752                },
   1753              },
   1754            ],
   1755          },
   1756        },
   1757      },
   1758    },
   1759    priority: 4,
   1760    frequency: {
   1761      custom: [
   1762        {
   1763          cap: 3,
   1764          period: 604800000, // Max 3 per week
   1765        },
   1766      ],
   1767      lifetime: 12,
   1768    },
   1769    targeting: `'cookiebanners.service.mode.privateBrowsing'|preferenceValue != 0 || 'cookiebanners.service.mode'|preferenceValue != 0`,
   1770  },
   1771  {
   1772    id: "INFOBAR_LAUNCH_ON_LOGIN",
   1773    groups: ["cfr"],
   1774    template: "infobar",
   1775    content: {
   1776      type: "global",
   1777      text: {
   1778        string_id: "launch-on-login-infobar-message",
   1779      },
   1780      buttons: [
   1781        {
   1782          label: {
   1783            string_id: "launch-on-login-learnmore",
   1784          },
   1785          supportPage: "make-firefox-automatically-open-when-you-start",
   1786          action: {
   1787            type: "CANCEL",
   1788          },
   1789        },
   1790        {
   1791          label: { string_id: "launch-on-login-infobar-reject-button" },
   1792          action: {
   1793            type: "CANCEL",
   1794          },
   1795        },
   1796        {
   1797          label: { string_id: "launch-on-login-infobar-confirm-button" },
   1798          primary: true,
   1799          action: {
   1800            type: "MULTI_ACTION",
   1801            data: {
   1802              actions: [
   1803                {
   1804                  type: "SET_PREF",
   1805                  data: {
   1806                    pref: {
   1807                      name: "browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt",
   1808                      value: true,
   1809                    },
   1810                  },
   1811                },
   1812                {
   1813                  type: "CONFIRM_LAUNCH_ON_LOGIN",
   1814                },
   1815              ],
   1816            },
   1817          },
   1818        },
   1819      ],
   1820    },
   1821    frequency: {
   1822      lifetime: 1,
   1823    },
   1824    trigger: { id: "defaultBrowserCheck" },
   1825    targeting: `source == 'newtab'
   1826    && 'browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt'|preferenceValue == false
   1827    && 'browser.startup.windowsLaunchOnLogin.enabled'|preferenceValue == true && isDefaultBrowser && !activeNotifications
   1828    && !launchOnLoginEnabled`,
   1829  },
   1830  {
   1831    id: "INFOBAR_LAUNCH_ON_LOGIN_FINAL",
   1832    groups: ["cfr"],
   1833    template: "infobar",
   1834    content: {
   1835      type: "global",
   1836      text: {
   1837        string_id: "launch-on-login-infobar-final-message",
   1838      },
   1839      buttons: [
   1840        {
   1841          label: {
   1842            string_id: "launch-on-login-learnmore",
   1843          },
   1844          supportPage: "make-firefox-automatically-open-when-you-start",
   1845          action: {
   1846            type: "CANCEL",
   1847          },
   1848        },
   1849        {
   1850          label: { string_id: "launch-on-login-infobar-final-reject-button" },
   1851          action: {
   1852            type: "SET_PREF",
   1853            data: {
   1854              pref: {
   1855                name: "browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt",
   1856                value: true,
   1857              },
   1858            },
   1859          },
   1860        },
   1861        {
   1862          label: { string_id: "launch-on-login-infobar-confirm-button" },
   1863          primary: true,
   1864          action: {
   1865            type: "MULTI_ACTION",
   1866            data: {
   1867              actions: [
   1868                {
   1869                  type: "SET_PREF",
   1870                  data: {
   1871                    pref: {
   1872                      name: "browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt",
   1873                      value: true,
   1874                    },
   1875                  },
   1876                },
   1877                {
   1878                  type: "CONFIRM_LAUNCH_ON_LOGIN",
   1879                },
   1880              ],
   1881            },
   1882          },
   1883        },
   1884      ],
   1885    },
   1886    frequency: {
   1887      lifetime: 1,
   1888    },
   1889    trigger: { id: "defaultBrowserCheck" },
   1890    targeting: `source == 'newtab'
   1891    && 'browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt'|preferenceValue == false
   1892    && 'browser.startup.windowsLaunchOnLogin.enabled'|preferenceValue == true && isDefaultBrowser && !activeNotifications
   1893    && messageImpressions.INFOBAR_LAUNCH_ON_LOGIN[messageImpressions.INFOBAR_LAUNCH_ON_LOGIN | length - 1]
   1894    && messageImpressions.INFOBAR_LAUNCH_ON_LOGIN[messageImpressions.INFOBAR_LAUNCH_ON_LOGIN | length - 1] <
   1895      currentDate|date - ${FOURTEEN_DAYS_IN_MS}
   1896    && !launchOnLoginEnabled`,
   1897  },
   1898  {
   1899    id: "FOX_DOODLE_SET_DEFAULT",
   1900    template: "spotlight",
   1901    groups: ["eco"],
   1902    skip_in_tests: "it fails unrelated tests",
   1903    content: {
   1904      backdrop: "transparent",
   1905      id: "FOX_DOODLE_SET_DEFAULT",
   1906      screens: [
   1907        {
   1908          id: "FOX_DOODLE_SET_DEFAULT_SCREEN",
   1909          content: {
   1910            logo: {
   1911              height: "125px",
   1912              imageURL:
   1913                "chrome://activity-stream/content/data/content/assets/fox-doodle-waving.gif",
   1914              reducedMotionImageURL:
   1915                "chrome://activity-stream/content/data/content/assets/fox-doodle-waving-static.png",
   1916            },
   1917            title: {
   1918              fontSize: "22px",
   1919              fontWeight: 590,
   1920              letterSpacing: 0,
   1921              paddingInline: "24px",
   1922              paddingBlock: "4px 0",
   1923              string_id: "fox-doodle-pin-headline",
   1924            },
   1925            subtitle: {
   1926              fontSize: "15px",
   1927              letterSpacing: 0,
   1928              lineHeight: "1.4",
   1929              marginBlock: "8px 16px",
   1930              paddingInline: "24px",
   1931              string_id: "fox-doodle-pin-body",
   1932            },
   1933            primary_button: {
   1934              action: {
   1935                navigate: true,
   1936                type: "SET_DEFAULT_BROWSER",
   1937              },
   1938              label: {
   1939                paddingBlock: "0",
   1940                paddingInline: "16px",
   1941                marginBlock: "4px 0",
   1942                string_id: "fox-doodle-pin-primary",
   1943              },
   1944            },
   1945            secondary_button: {
   1946              action: {
   1947                navigate: true,
   1948              },
   1949              label: {
   1950                marginBlock: "0 -20px",
   1951                string_id: "fox-doodle-pin-secondary",
   1952              },
   1953            },
   1954            dismiss_button: {
   1955              action: {
   1956                navigate: true,
   1957              },
   1958            },
   1959          },
   1960        },
   1961      ],
   1962      template: "multistage",
   1963      transitions: true,
   1964    },
   1965    frequency: {
   1966      lifetime: 2,
   1967    },
   1968    targeting: `source == 'startup'
   1969    && !isMajorUpgrade
   1970    && !activeNotifications
   1971    && !isDefaultBrowser
   1972    && !willShowDefaultPrompt
   1973    && 'browser.shell.checkDefaultBrowser'|preferenceValue
   1974    && (currentDate|date - profileAgeCreated|date) / 86400000 >= 28
   1975    && previousSessionEnd
   1976    && userPrefs.cfrFeatures == true`,
   1977    trigger: {
   1978      id: "defaultBrowserCheck",
   1979    },
   1980  },
   1981  {
   1982    id: "RESTORE_FROM_BACKUP",
   1983    template: "spotlight",
   1984    groups: [""],
   1985    content: {
   1986      template: "multistage",
   1987      transitions: true,
   1988      modal: "tab",
   1989      backdrop: "transparent",
   1990      id: "RESTORE_FROM_BACKUP",
   1991      screens: [
   1992        {
   1993          id: "RESTORE_FROM_BACKUP_SCREEN",
   1994          content: {
   1995            position: "split",
   1996            split_content_padding_block: "166px",
   1997            background:
   1998              "url('chrome://activity-stream/content/data/content/assets/fox-doodle-backup.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   1999            logo: {},
   2000            title: {
   2001              string_id: "restored-from-backup-success-title",
   2002            },
   2003            primary_button: {
   2004              label: {
   2005                string_id:
   2006                  "restored-from-backup-success-no-checklist-primary-button",
   2007                paddingBlock: "4px",
   2008                paddingInline: "16px",
   2009              },
   2010              action: {
   2011                navigate: true,
   2012              },
   2013            },
   2014          },
   2015        },
   2016      ],
   2017    },
   2018    targeting:
   2019      "source == 'startup' && !doesAppNeedPin && (!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue",
   2020    trigger: {
   2021      id: "defaultBrowserCheck",
   2022    },
   2023    frequency: {
   2024      lifetime: 1,
   2025    },
   2026  },
   2027  {
   2028    id: "RESTORE_FROM_BACKUP_NEED_DEFAULT_NEED_PIN",
   2029    template: "spotlight",
   2030    groups: [""],
   2031    content: {
   2032      template: "multistage",
   2033      transitions: true,
   2034      modal: "tab",
   2035      backdrop: "transparent",
   2036      id: "RESTORE_FROM_BACKUP_NEED_DEFAULT_NEED_PIN",
   2037      screens: [
   2038        {
   2039          id: "RESTORE_FROM_BACKUP_NEED_DEFAULT_NEED_PIN_SCREEN",
   2040          content: {
   2041            position: "split",
   2042            background:
   2043              "url('chrome://activity-stream/content/data/content/assets/fox-doodle-backup.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   2044            logo: {},
   2045            title: {
   2046              string_id: "restored-from-backup-success-title",
   2047            },
   2048            subtitle: {
   2049              string_id: "restored-from-backup-success-with-checklist-subtitle",
   2050              paddingInline: "0 48px",
   2051            },
   2052            primary_button: {
   2053              label: {
   2054                string_id:
   2055                  "restored-from-backup-success-with-checklist-primary-button",
   2056                paddingBlock: "4px",
   2057                paddingInline: "16px",
   2058              },
   2059              action: {
   2060                type: "MULTI_ACTION",
   2061                collectSelect: true,
   2062                navigate: true,
   2063                data: {
   2064                  actions: [],
   2065                },
   2066              },
   2067            },
   2068            secondary_button: {
   2069              label: {
   2070                string_id:
   2071                  "restored-from-backup-success-with-checklist-secondary-button",
   2072              },
   2073              action: {
   2074                navigate: true,
   2075              },
   2076              has_arrow_icon: true,
   2077            },
   2078            tiles: {
   2079              type: "multiselect",
   2080              style: {
   2081                gap: "10px",
   2082              },
   2083              data: [
   2084                {
   2085                  id: "checkbox-1",
   2086                  defaultValue: true,
   2087                  label: {
   2088                    string_id:
   2089                      "mr2022-onboarding-easy-setup-set-default-checkbox-label",
   2090                  },
   2091                  action: {
   2092                    type: "SET_DEFAULT_BROWSER",
   2093                  },
   2094                },
   2095                {
   2096                  id: "checkbox-2",
   2097                  defaultValue: true,
   2098                  label: {
   2099                    string_id: isMSIX
   2100                      ? "mr2022-onboarding-pin-primary-button-label-msix"
   2101                      : "mr2022-onboarding-pin-primary-button-label",
   2102                  },
   2103                  action: {
   2104                    type: "MULTI_ACTION",
   2105                    data: {
   2106                      actions: [
   2107                        {
   2108                          type: "PIN_FIREFOX_TO_TASKBAR",
   2109                        },
   2110                        {
   2111                          type: "PIN_FIREFOX_TO_START_MENU",
   2112                        },
   2113                      ],
   2114                    },
   2115                  },
   2116                },
   2117              ],
   2118            },
   2119          },
   2120        },
   2121      ],
   2122    },
   2123    targeting:
   2124      "source == 'startup' && doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue",
   2125    trigger: {
   2126      id: "defaultBrowserCheck",
   2127    },
   2128    frequency: {
   2129      lifetime: 1,
   2130    },
   2131  },
   2132  {
   2133    id: "RESTORE_FROM_BACKUP_NEED_DEFAULT",
   2134    template: "spotlight",
   2135    groups: [""],
   2136    content: {
   2137      template: "multistage",
   2138      transitions: true,
   2139      modal: "tab",
   2140      backdrop: "transparent",
   2141      id: "RESTORE_FROM_BACKUP_NEED_DEFAULT",
   2142      screens: [
   2143        {
   2144          id: "RESTORE_FROM_BACKUP_NEED_DEFAULT_SCREEN",
   2145          content: {
   2146            position: "split",
   2147            background:
   2148              "url('chrome://activity-stream/content/data/content/assets/fox-doodle-backup.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   2149            logo: {},
   2150            title: {
   2151              string_id: "restored-from-backup-success-title",
   2152            },
   2153            subtitle: {
   2154              string_id: "restored-from-backup-success-with-checklist-subtitle",
   2155              paddingInline: "0 48px",
   2156            },
   2157            primary_button: {
   2158              label: {
   2159                string_id:
   2160                  "restored-from-backup-success-with-checklist-primary-button",
   2161                paddingBlock: "4px",
   2162                paddingInline: "16px",
   2163              },
   2164              action: {
   2165                type: "MULTI_ACTION",
   2166                collectSelect: true,
   2167                navigate: true,
   2168                data: {
   2169                  actions: [],
   2170                },
   2171              },
   2172            },
   2173            secondary_button: {
   2174              label: {
   2175                string_id:
   2176                  "restored-from-backup-success-with-checklist-secondary-button",
   2177              },
   2178              action: {
   2179                navigate: true,
   2180              },
   2181              has_arrow_icon: true,
   2182            },
   2183            tiles: {
   2184              type: "multiselect",
   2185              style: {
   2186                gap: "10px",
   2187              },
   2188              data: [
   2189                {
   2190                  id: "checkbox-1",
   2191                  defaultValue: true,
   2192                  label: {
   2193                    string_id:
   2194                      "mr2022-onboarding-easy-setup-set-default-checkbox-label",
   2195                  },
   2196                  action: {
   2197                    type: "SET_DEFAULT_BROWSER",
   2198                  },
   2199                },
   2200              ],
   2201            },
   2202          },
   2203        },
   2204      ],
   2205    },
   2206    targeting:
   2207      "source == 'startup' && !doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue",
   2208    trigger: {
   2209      id: "defaultBrowserCheck",
   2210    },
   2211    frequency: {
   2212      lifetime: 1,
   2213    },
   2214  },
   2215  {
   2216    id: "RESTORE_FROM_BACKUP_NEED_PIN",
   2217    template: "spotlight",
   2218    groups: [""],
   2219    content: {
   2220      template: "multistage",
   2221      transitions: true,
   2222      modal: "tab",
   2223      backdrop: "transparent",
   2224      id: "RESTORE_FROM_BACKUP_NEED_PIN",
   2225      screens: [
   2226        {
   2227          id: "RESTORE_FROM_BACKUP_NEED_PIN_SCREEN",
   2228          content: {
   2229            position: "split",
   2230            background:
   2231              "url('chrome://activity-stream/content/data/content/assets/fox-doodle-backup.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
   2232            logo: {},
   2233            title: {
   2234              string_id: "restored-from-backup-success-title",
   2235            },
   2236            subtitle: {
   2237              string_id: "restored-from-backup-success-with-checklist-subtitle",
   2238              paddingInline: "0 48px",
   2239            },
   2240            primary_button: {
   2241              label: {
   2242                string_id:
   2243                  "restored-from-backup-success-with-checklist-primary-button",
   2244                paddingBlock: "4px",
   2245                paddingInline: "16px",
   2246              },
   2247              action: {
   2248                type: "MULTI_ACTION",
   2249                collectSelect: true,
   2250                navigate: true,
   2251                data: {
   2252                  actions: [],
   2253                },
   2254              },
   2255            },
   2256            secondary_button: {
   2257              label: {
   2258                string_id:
   2259                  "restored-from-backup-success-with-checklist-secondary-button",
   2260              },
   2261              action: {
   2262                navigate: true,
   2263              },
   2264              has_arrow_icon: true,
   2265            },
   2266            tiles: {
   2267              type: "multiselect",
   2268              style: {
   2269                gap: "10px",
   2270              },
   2271              data: [
   2272                {
   2273                  id: "checkbox-1",
   2274                  defaultValue: true,
   2275                  label: {
   2276                    string_id: isMSIX
   2277                      ? "mr2022-onboarding-pin-primary-button-label-msix"
   2278                      : "mr2022-onboarding-pin-primary-button-label",
   2279                  },
   2280                  action: {
   2281                    type: "MULTI_ACTION",
   2282                    data: {
   2283                      actions: [
   2284                        {
   2285                          type: "PIN_FIREFOX_TO_TASKBAR",
   2286                        },
   2287                        {
   2288                          type: "PIN_FIREFOX_TO_START_MENU",
   2289                        },
   2290                      ],
   2291                    },
   2292                  },
   2293                },
   2294              ],
   2295            },
   2296          },
   2297        },
   2298      ],
   2299    },
   2300    targeting:
   2301      "source == 'startup' && doesAppNeedPin && !willShowDefaultPrompt &&(!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue",
   2302    trigger: {
   2303      id: "defaultBrowserCheck",
   2304    },
   2305    frequency: {
   2306      lifetime: 1,
   2307    },
   2308  },
   2309  {
   2310    id: "TAIL_FOX_SET_DEFAULT",
   2311    template: "spotlight",
   2312    groups: ["eco"],
   2313    skip_in_tests: "it fails unrelated tests",
   2314    content: {
   2315      backdrop: "transparent",
   2316      id: "TAIL_FOX_SET_DEFAULT_CONTENT",
   2317      screens: [
   2318        {
   2319          id: "TAIL_FOX_SET_DEFAULT_SCREEN",
   2320          content: {
   2321            logo: {
   2322              height: "140px",
   2323              imageURL:
   2324                "chrome://activity-stream/content/data/content/assets/fox-doodle-tail.png",
   2325              reducedMotionImageURL:
   2326                "chrome://activity-stream/content/data/content/assets/fox-doodle-tail.png",
   2327            },
   2328            title: {
   2329              fontSize: "22px",
   2330              fontWeight: 590,
   2331              letterSpacing: 0,
   2332              paddingInline: "24px",
   2333              paddingBlock: "4px 0",
   2334              string_id: "tail-fox-spotlight-title",
   2335            },
   2336            subtitle: {
   2337              fontSize: "15px",
   2338              letterSpacing: 0,
   2339              lineHeight: "1.4",
   2340              marginBlock: "8px 16px",
   2341              paddingInline: "24px",
   2342              string_id: "tail-fox-spotlight-subtitle",
   2343            },
   2344            primary_button: {
   2345              action: {
   2346                navigate: true,
   2347                type: "SET_DEFAULT_BROWSER",
   2348              },
   2349              label: {
   2350                paddingBlock: "0",
   2351                paddingInline: "16px",
   2352                marginBlock: "4px 0",
   2353                string_id: "tail-fox-spotlight-primary-button",
   2354              },
   2355            },
   2356            secondary_button: {
   2357              action: {
   2358                navigate: true,
   2359              },
   2360              label: {
   2361                marginBlock: "0 -20px",
   2362                string_id: "tail-fox-spotlight-secondary-button",
   2363              },
   2364            },
   2365            dismiss_button: {
   2366              action: {
   2367                navigate: true,
   2368              },
   2369            },
   2370          },
   2371        },
   2372      ],
   2373      template: "multistage",
   2374      transitions: true,
   2375    },
   2376    frequency: {
   2377      lifetime: 1,
   2378    },
   2379    targeting: `source == 'startup'
   2380    && !isMajorUpgrade
   2381    && !activeNotifications
   2382    && !isDefaultBrowser
   2383    && !willShowDefaultPrompt
   2384    && 'browser.shell.checkDefaultBrowser'|preferenceValue
   2385    && (currentDate|date - profileAgeCreated|date) / 86400000 <= 28
   2386    && (currentDate|date - profileAgeCreated|date) / 86400000 >= 7
   2387    && previousSessionEnd
   2388    && userPrefs.cfrFeatures == true`,
   2389    trigger: {
   2390      id: "defaultBrowserCheck",
   2391    },
   2392  },
   2393  {
   2394    id: "SET_DEFAULT_BROWSER_GUIDANCE_NOTIFICATION_WIN10",
   2395    template: "toast_notification",
   2396    content: {
   2397      title: {
   2398        string_id: "default-browser-guidance-notification-title",
   2399      },
   2400      body: {
   2401        string_id:
   2402          "default-browser-guidance-notification-body-instruction-win10",
   2403      },
   2404      launch_action: {
   2405        type: "OPEN_URL",
   2406        data: {
   2407          args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/win-set-firefox-default-browser",
   2408          where: "tabshifted",
   2409        },
   2410      },
   2411      requireInteraction: true,
   2412      actions: [
   2413        {
   2414          action: "info-page",
   2415          title: {
   2416            string_id: "default-browser-guidance-notification-info-page",
   2417          },
   2418          launch_action: {
   2419            type: "OPEN_URL",
   2420            data: {
   2421              args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/win-set-firefox-default-browser",
   2422              where: "tabshifted",
   2423            },
   2424          },
   2425        },
   2426        {
   2427          action: "dismiss",
   2428          title: {
   2429            string_id: "default-browser-guidance-notification-dismiss",
   2430          },
   2431          windowsSystemActivationType: true,
   2432        },
   2433      ],
   2434      tag: "set-default-guidance-notification",
   2435    },
   2436    // Both Windows 10 and 11 return `os.windowsVersion == 10.0`. We limit to
   2437    // only Windows 10 with `os.windowsBuildNumber < 22000`. We need this due to
   2438    // Windows 10 and 11 having substantively different UX for Windows Settings.
   2439    targeting:
   2440      "os.isWindows && os.windowsVersion >= 10.0 && os.windowsBuildNumber < 22000",
   2441    trigger: { id: "deeplinkedToWindowsSettingsUI" },
   2442  },
   2443  {
   2444    id: "SET_DEFAULT_BROWSER_GUIDANCE_NOTIFICATION_WIN11",
   2445    template: "toast_notification",
   2446    content: {
   2447      title: {
   2448        string_id: "default-browser-guidance-notification-title",
   2449      },
   2450      body: {
   2451        string_id:
   2452          "default-browser-guidance-notification-body-instruction-win11",
   2453      },
   2454      launch_action: {
   2455        type: "OPEN_URL",
   2456        data: {
   2457          args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/win-set-firefox-default-browser",
   2458          where: "tabshifted",
   2459        },
   2460      },
   2461      requireInteraction: true,
   2462      actions: [
   2463        {
   2464          action: "info-page",
   2465          title: {
   2466            string_id: "default-browser-guidance-notification-info-page",
   2467          },
   2468          launch_action: {
   2469            type: "OPEN_URL",
   2470            data: {
   2471              args: "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/win-set-firefox-default-browser",
   2472              where: "tabshifted",
   2473            },
   2474          },
   2475        },
   2476        {
   2477          action: "dismiss",
   2478          title: {
   2479            string_id: "default-browser-guidance-notification-dismiss",
   2480          },
   2481          windowsSystemActivationType: true,
   2482        },
   2483      ],
   2484      tag: "set-default-guidance-notification",
   2485    },
   2486    // Both Windows 10 and 11 return `os.windowsVersion == 10.0`. We limit to
   2487    // only Windows 11 with `os.windowsBuildNumber >= 22000`. We need this due to
   2488    // Windows 10 and 11 having substantively different UX for Windows Settings.
   2489    targeting:
   2490      "os.isWindows && os.windowsVersion >= 10.0 && os.windowsBuildNumber >= 22000",
   2491    trigger: { id: "deeplinkedToWindowsSettingsUI" },
   2492  },
   2493  {
   2494    id: "FXA_ACCOUNTS_BADGE_REVISED",
   2495    template: "toolbar_badge",
   2496    content: {
   2497      delay: 1000,
   2498      target: "fxa-toolbar-menu-button",
   2499    },
   2500    skip_in_tests: "it's covered by browser_asrouter_toolbarbadge.js",
   2501    targeting:
   2502      "source == 'newtab' && !hasAccessedFxAPanel && !usesFirefoxSync && isFxAEnabled && !isFxASignedIn",
   2503    trigger: {
   2504      id: "defaultBrowserCheck",
   2505    },
   2506  },
   2507  {
   2508    id: "INFOBAR_DEFAULT_AND_PIN_87",
   2509    groups: ["cfr"],
   2510    content: {
   2511      text: {
   2512        string_id: "default-browser-notification-message",
   2513      },
   2514      type: "global",
   2515      buttons: [
   2516        {
   2517          label: {
   2518            string_id: "default-browser-notification-button",
   2519          },
   2520          action: {
   2521            type: "PIN_AND_DEFAULT",
   2522          },
   2523          primary: true,
   2524          accessKey: "P",
   2525        },
   2526      ],
   2527      category: "cfrFeatures",
   2528      bucket_id: "INFOBAR_DEFAULT_AND_PIN_87",
   2529    },
   2530    trigger: {
   2531      id: "defaultBrowserCheck",
   2532    },
   2533    template: "infobar",
   2534    frequency: {
   2535      custom: [
   2536        {
   2537          cap: 1,
   2538          period: 3024000000,
   2539        },
   2540      ],
   2541      lifetime: 2,
   2542    },
   2543    targeting:
   2544      "(firefoxVersion >= 138 && source == 'startup' && !isDefaultBrowser && !'browser.shell.checkDefaultBrowser'|preferenceValue && currentDate|date - 'browser.shell.userDisabledDefaultCheck'|preferenceValue * 1000 >= 604800000 && isMajorUpgrade != true && platformName != 'linux' && ((currentDate|date - profileAgeCreated) / 604800000) >= 5 && !activeNotifications && 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features'|preferenceValue && ((currentDate|date - profileAgeCreated) / 604800000) < 15",
   2545  },
   2546  {
   2547    id: "FINISH_SETUP_CHECKLIST",
   2548    template: "feature_callout",
   2549    content: {
   2550      id: "FINISH_SETUP_CHECKLIST",
   2551      template: "multistage",
   2552      backdrop: "transparent",
   2553      transitions: false,
   2554      disableHistoryUpdates: true,
   2555      screens: [
   2556        {
   2557          id: "FINISH_SETUP_CHECKLIST",
   2558          anchors: [
   2559            {
   2560              selector: "#fxms-bmb-button",
   2561              panel_position: {
   2562                anchor_attachment: "bottomcenter",
   2563                callout_attachment: "topright",
   2564                offset_y: 4,
   2565              },
   2566              no_open_on_anchor: true,
   2567            },
   2568            {
   2569              selector: "#FINISH_SETUP_BUTTON",
   2570              panel_position: {
   2571                anchor_attachment: "bottomcenter",
   2572                callout_attachment: "topright",
   2573                offset_y: 4,
   2574              },
   2575              no_open_on_anchor: true,
   2576            },
   2577          ],
   2578          content: {
   2579            page_event_listeners: [
   2580              {
   2581                params: {
   2582                  type: "tourend",
   2583                },
   2584                action: {
   2585                  type: "SET_PREF",
   2586                  data: {
   2587                    pref: {
   2588                      name: "messaging-system-action.easyChecklist.open",
   2589                      value: "false",
   2590                    },
   2591                  },
   2592                },
   2593              },
   2594            ],
   2595            position: "callout",
   2596            title: {
   2597              string_id: "onboarding-checklist-title",
   2598              marginInline: "3px 40px",
   2599              fontWeight: "600",
   2600              fontSize: "16px",
   2601            },
   2602            title_logo: {
   2603              alignment: "top",
   2604              imageURL: "chrome://branding/content/about-logo.png",
   2605            },
   2606            action_checklist_subtitle: {
   2607              string_id: "onboarding-checklist-subtitle",
   2608            },
   2609            tiles: {
   2610              type: "action_checklist",
   2611              data: [
   2612                {
   2613                  id: "action-checklist-set-to-default",
   2614                  targeting: "isDefaultBrowserUncached",
   2615                  label: {
   2616                    string_id: "onboarding-checklist-set-default",
   2617                  },
   2618                  action: {
   2619                    type: "SET_DEFAULT_BROWSER",
   2620                  },
   2621                },
   2622                {
   2623                  id: "action-checklist-pin-to-taskbar",
   2624                  targeting: "!doesAppNeedPinUncached",
   2625                  label: {
   2626                    string_id: "onboarding-checklist-pin",
   2627                  },
   2628                  action: {
   2629                    type: "MULTI_ACTION",
   2630                    data: {
   2631                      actions: [
   2632                        {
   2633                          type: "PIN_FIREFOX_TO_TASKBAR",
   2634                        },
   2635                        {
   2636                          type: "PIN_FIREFOX_TO_START_MENU",
   2637                        },
   2638                      ],
   2639                    },
   2640                  },
   2641                },
   2642                {
   2643                  id: "action-checklist-import-data",
   2644                  targeting:
   2645                    "hasMigratedBookmarks || hasMigratedCSVPasswords || hasMigratedHistory || hasMigratedPasswords",
   2646                  label: {
   2647                    string_id: "onboarding-checklist-import",
   2648                  },
   2649                  action: {
   2650                    type: "SHOW_MIGRATION_WIZARD",
   2651                  },
   2652                  showExternalLinkIcon: true,
   2653                },
   2654                {
   2655                  id: "action-checklist-explore-extensions",
   2656                  targeting:
   2657                    "'messaging-system-action.hasOpenedExtensions'|preferenceValue || addonsInfo.hasInstalledAddons",
   2658                  label: {
   2659                    string_id: "onboarding-checklist-extension",
   2660                  },
   2661                  action: {
   2662                    type: "MULTI_ACTION",
   2663                    data: {
   2664                      actions: [
   2665                        {
   2666                          type: "SET_PREF",
   2667                          data: {
   2668                            pref: {
   2669                              name: "messaging-system-action.hasOpenedExtensions",
   2670                              value: "true",
   2671                            },
   2672                          },
   2673                        },
   2674                        {
   2675                          type: "OPEN_URL",
   2676                          data: {
   2677                            args: "https://addons.mozilla.org/en-US/firefox/collections/4757633/b4d5649fb087446aa05add5f0258c3/?page=1&collection_sort=-popularity",
   2678                            where: "current",
   2679                          },
   2680                        },
   2681                      ],
   2682                    },
   2683                  },
   2684                  showExternalLinkIcon: true,
   2685                },
   2686                {
   2687                  id: "action-checklist-sign-in",
   2688                  targeting: "isFxASignedIn",
   2689                  label: {
   2690                    string_id: "onboarding-checklist-sign-up",
   2691                  },
   2692                  action: {
   2693                    type: "FXA_SIGNIN_FLOW",
   2694                    data: {
   2695                      entrypoint: "fx-onboarding-checklist",
   2696                      extraParams: {
   2697                        utm_content: "migration-onboarding",
   2698                        utm_source: "fx-new-device-sync",
   2699                        utm_medium: "firefox-desktop",
   2700                        utm_campaign: "migration",
   2701                      },
   2702                    },
   2703                  },
   2704                  showExternalLinkIcon: true,
   2705                },
   2706              ],
   2707            },
   2708            dismiss_button: {
   2709              action: {
   2710                type: "MULTI_ACTION",
   2711                dismiss: true,
   2712                data: {
   2713                  actions: [
   2714                    {
   2715                      type: "SET_PREF",
   2716                      data: {
   2717                        pref: {
   2718                          name: "easyChecklist.open",
   2719                          value: false,
   2720                        },
   2721                      },
   2722                    },
   2723                  ],
   2724                },
   2725              },
   2726            },
   2727          },
   2728        },
   2729      ],
   2730    },
   2731    priority: 3,
   2732    targeting:
   2733      "'messaging-system-action.easyChecklist.open' | preferenceValue == true",
   2734    trigger: {
   2735      id: "preferenceObserver",
   2736      params: ["messaging-system-action.easyChecklist.open"],
   2737    },
   2738  },
   2739  {
   2740    id: "FINISH_SETUP_CHECKLIST",
   2741    template: "feature_callout",
   2742    content: {
   2743      id: "FINISH_SETUP_CHECKLIST",
   2744      template: "multistage",
   2745      backdrop: "transparent",
   2746      transitions: false,
   2747      disableHistoryUpdates: true,
   2748      screens: [
   2749        {
   2750          id: "FINISH_SETUP_CHECKLIST",
   2751          anchors: [
   2752            {
   2753              selector: "#fxms-bmb-button",
   2754              panel_position: {
   2755                anchor_attachment: "bottomcenter",
   2756                callout_attachment: "topright",
   2757                offset_y: 4,
   2758              },
   2759              no_open_on_anchor: true,
   2760            },
   2761            {
   2762              selector: "#FINISH_SETUP_BUTTON",
   2763              panel_position: {
   2764                anchor_attachment: "bottomcenter",
   2765                callout_attachment: "topright",
   2766                offset_y: 4,
   2767              },
   2768              no_open_on_anchor: true,
   2769            },
   2770            {
   2771              selector: "#PersonalToolbar",
   2772              panel_position: {
   2773                anchor_attachment: "bottomright",
   2774                callout_attachment: "topright",
   2775                offset_x: -24,
   2776                offset_y: 24,
   2777              },
   2778              no_open_on_anchor: true,
   2779              hide_arrow: true,
   2780            },
   2781          ],
   2782          content: {
   2783            page_event_listeners: [
   2784              {
   2785                params: {
   2786                  type: "tourend",
   2787                },
   2788                action: {
   2789                  type: "SET_PREF",
   2790                  data: {
   2791                    pref: {
   2792                      name: "messaging-system-action.easyChecklist.open",
   2793                      value: "false",
   2794                    },
   2795                  },
   2796                },
   2797              },
   2798            ],
   2799            position: "callout",
   2800            title: {
   2801              string_id: "onboarding-checklist-title",
   2802              marginInline: "3px 40px",
   2803              fontWeight: "600",
   2804              fontSize: "16px",
   2805            },
   2806            title_logo: {
   2807              alignment: "top",
   2808              imageURL: "chrome://branding/content/about-logo.png",
   2809            },
   2810            action_checklist_subtitle: {
   2811              string_id: "onboarding-checklist-subtitle",
   2812            },
   2813            tiles: {
   2814              type: "action_checklist",
   2815              data: [
   2816                {
   2817                  id: "action-checklist-set-to-default",
   2818                  targeting: "isDefaultBrowserUncached",
   2819                  label: {
   2820                    string_id: "onboarding-checklist-set-default",
   2821                  },
   2822                  action: {
   2823                    type: "SET_DEFAULT_BROWSER",
   2824                  },
   2825                },
   2826                {
   2827                  id: "action-checklist-pin-to-taskbar",
   2828                  targeting: "!doesAppNeedPinUncached",
   2829                  label: {
   2830                    string_id: "onboarding-checklist-pin",
   2831                  },
   2832                  action: {
   2833                    type: "MULTI_ACTION",
   2834                    data: {
   2835                      actions: [
   2836                        {
   2837                          type: "PIN_FIREFOX_TO_TASKBAR",
   2838                        },
   2839                        {
   2840                          type: "PIN_FIREFOX_TO_START_MENU",
   2841                        },
   2842                      ],
   2843                    },
   2844                  },
   2845                },
   2846                {
   2847                  id: "action-checklist-import-data",
   2848                  targeting:
   2849                    "hasMigratedBookmarks || hasMigratedCSVPasswords || hasMigratedHistory || hasMigratedPasswords",
   2850                  label: {
   2851                    string_id: "onboarding-checklist-import",
   2852                  },
   2853                  action: {
   2854                    type: "SHOW_MIGRATION_WIZARD",
   2855                  },
   2856                  showExternalLinkIcon: true,
   2857                },
   2858                {
   2859                  id: "action-checklist-explore-extensions",
   2860                  targeting:
   2861                    "'messaging-system-action.hasOpenedExtensions'|preferenceValue || addonsInfo.hasInstalledAddons",
   2862                  label: {
   2863                    string_id: "onboarding-checklist-extension",
   2864                  },
   2865                  action: {
   2866                    type: "MULTI_ACTION",
   2867                    data: {
   2868                      actions: [
   2869                        {
   2870                          type: "SET_PREF",
   2871                          data: {
   2872                            pref: {
   2873                              name: "messaging-system-action.hasOpenedExtensions",
   2874                              value: "true",
   2875                            },
   2876                          },
   2877                        },
   2878                        {
   2879                          type: "OPEN_URL",
   2880                          data: {
   2881                            args: "https://addons.mozilla.org/en-US/firefox/collections/4757633/b4d5649fb087446aa05add5f0258c3/?page=1&collection_sort=-popularity",
   2882                            where: "current",
   2883                          },
   2884                        },
   2885                      ],
   2886                    },
   2887                  },
   2888                  showExternalLinkIcon: true,
   2889                },
   2890                {
   2891                  id: "action-checklist-sign-in",
   2892                  targeting: "isFxASignedIn",
   2893                  label: {
   2894                    string_id: "onboarding-checklist-sign-up",
   2895                  },
   2896                  action: {
   2897                    type: "FXA_SIGNIN_FLOW",
   2898                    data: {
   2899                      entrypoint: "fx-onboarding-checklist",
   2900                      extraParams: {
   2901                        utm_content: "migration-onboarding",
   2902                        utm_source: "fx-new-device-sync",
   2903                        utm_medium: "firefox-desktop",
   2904                        utm_campaign: "migration",
   2905                      },
   2906                    },
   2907                  },
   2908                  showExternalLinkIcon: true,
   2909                },
   2910              ],
   2911            },
   2912            dismiss_button: {
   2913              action: {
   2914                type: "MULTI_ACTION",
   2915                dismiss: true,
   2916                data: {
   2917                  actions: [
   2918                    {
   2919                      type: "SET_PREF",
   2920                      data: {
   2921                        pref: {
   2922                          name: "easyChecklist.open",
   2923                          value: false,
   2924                        },
   2925                      },
   2926                    },
   2927                  ],
   2928                },
   2929              },
   2930            },
   2931          },
   2932        },
   2933      ],
   2934    },
   2935    priority: 3,
   2936    targeting:
   2937      "'messaging-system-action.easyChecklist.open' | preferenceValue == true",
   2938    trigger: {
   2939      id: "messagesLoaded",
   2940    },
   2941  },
   2942  {
   2943    id: "MULTIPROFILE_DATA_COLLECTION_CHANGED_INFOBAR",
   2944    template: "infobar",
   2945    targeting: "true",
   2946    content: {
   2947      priority: 3,
   2948      text: { string_id: "multiprofile-data-collection-message" },
   2949      buttons: [
   2950        {
   2951          label: { string_id: "multiprofile-data-collection-view-settings" },
   2952          action: {
   2953            type: "OPEN_PREFERENCES_PAGE",
   2954            data: { category: "privacy-reports" },
   2955            dismiss: true,
   2956          },
   2957        },
   2958        {
   2959          label: { string_id: "multiprofile-data-collection-dismiss" },
   2960          action: { type: "CANCEL", dismiss: true },
   2961        },
   2962      ],
   2963    },
   2964    trigger: {
   2965      id: "selectableProfilesUpdated",
   2966    },
   2967  },
   2968  {
   2969    id: "updated-privacy-notice-notification-infobar",
   2970    groups: ["cfr"],
   2971    template: "infobar",
   2972    content: {
   2973      impression_action: {
   2974        type: "MULTI_ACTION",
   2975        orderedExecution: true,
   2976        data: {
   2977          actions: [
   2978            {
   2979              type: "SET_PREF",
   2980              data: {
   2981                pref: {
   2982                  name: "termsofuse.firstAcceptedDate",
   2983                  value: {
   2984                    copyFromPref: "termsofuse.acceptedDate",
   2985                  },
   2986                },
   2987              },
   2988            },
   2989            {
   2990              type: "SET_PREF",
   2991              data: {
   2992                pref: {
   2993                  name: "termsofuse.acceptedDate",
   2994                  value: {
   2995                    timestamp: true,
   2996                  },
   2997                },
   2998              },
   2999            },
   3000          ],
   3001        },
   3002      },
   3003      text: {
   3004        string_id: "existing-user-privacy-notice-update-message",
   3005        args: { where: "tabshifted" },
   3006      },
   3007      linkUrls: {
   3008        "privacy-notice-link": "https://www.mozilla.org/privacy/firefox/next/",
   3009      },
   3010      type: "tab",
   3011      buttons: [
   3012        {
   3013          label: {
   3014            string_id: "existing-user-tou-learn-more",
   3015          },
   3016          action: {
   3017            type: "OPEN_URL",
   3018            data: {
   3019              where: "tabshifted",
   3020              args: "https://www.mozilla.org/privacy/firefox/update/",
   3021            },
   3022            dismiss: false,
   3023          },
   3024          accessKey: "L",
   3025        },
   3026      ],
   3027    },
   3028    trigger: {
   3029      id: "defaultBrowserCheck",
   3030    },
   3031    frequency: {
   3032      lifetime: 1,
   3033    },
   3034    priority: 2,
   3035    targeting:
   3036      "('termsofuse.acceptedDate'|preferenceValue != '0') && (('termsofuse.acceptedDate'|preferenceValue * 1) < 1765972800000)",
   3037  },
   3038 ];
   3039 
   3040 const PREONBOARDING_MESSAGES = () => [
   3041  {
   3042    id: "NEW_USER_TOU_ONBOARDING",
   3043    enabled: true,
   3044    requireAction: true,
   3045    currentVersion: 4,
   3046    minimumVersion: 4,
   3047    firstRunURL: "https://www.mozilla.org/privacy/firefox/",
   3048    screens: [
   3049      {
   3050        id: "TOU_ONBOARDING",
   3051        content: {
   3052          action_buttons_above_content: true,
   3053          screen_style: {
   3054            overflow: "auto",
   3055            display: "block",
   3056            padding: "40px 0 0 0",
   3057            width: "560px",
   3058          },
   3059          logo: {
   3060            imageURL: "chrome://branding/content/about-logo.png",
   3061            height: "40px",
   3062            width: "40px",
   3063          },
   3064          title: {
   3065            string_id: "preonboarding-title",
   3066          },
   3067          subtitle: {
   3068            string_id: "preonboarding-subtitle",
   3069            paddingInline: "24px",
   3070          },
   3071          tiles: [
   3072            {
   3073              type: "embedded_browser",
   3074              id: "terms_of_use",
   3075              header: {
   3076                title: {
   3077                  string_id: "preonboarding-terms-of-use-header-button-title",
   3078                },
   3079              },
   3080              data: {
   3081                style: {
   3082                  width: "100%",
   3083                  height: "200px",
   3084                },
   3085                url: "https://mozilla.org/about/legal/terms/firefox/?v=product",
   3086              },
   3087            },
   3088            {
   3089              type: "embedded_browser",
   3090              id: "privacy_notice",
   3091              header: {
   3092                title: {
   3093                  string_id: "preonboarding-privacy-notice-header-button-title",
   3094                },
   3095              },
   3096              data: {
   3097                style: {
   3098                  width: "100%",
   3099                  height: "200px",
   3100                },
   3101                url: "https://mozilla.org/privacy/firefox/?v=product",
   3102              },
   3103            },
   3104            {
   3105              type: "multiselect",
   3106              header: {
   3107                title: {
   3108                  string_id: "preonboarding-manage-data-header-button-title",
   3109                },
   3110              },
   3111              data: [
   3112                {
   3113                  id: "interaction-data",
   3114                  type: "checkbox",
   3115                  defaultValue: true,
   3116                  label: {
   3117                    string_id: "preonboarding-checklist-interaction-data-label",
   3118                  },
   3119                  description: {
   3120                    string_id:
   3121                      "preonboarding-checklist-interaction-data-description",
   3122                  },
   3123                  action: {
   3124                    type: "SET_PREF",
   3125                    data: {
   3126                      pref: {
   3127                        name: "datareporting.healthreport.uploadEnabled",
   3128                        value: true,
   3129                      },
   3130                    },
   3131                  },
   3132                  uncheckedAction: {
   3133                    type: "MULTI_ACTION",
   3134                    data: {
   3135                      orderedExecution: true,
   3136                      actions: [
   3137                        {
   3138                          type: "SET_PREF",
   3139                          data: {
   3140                            pref: {
   3141                              name: "datareporting.healthreport.uploadEnabled",
   3142                              value: false,
   3143                            },
   3144                          },
   3145                        },
   3146                        {
   3147                          type: "SUBMIT_ONBOARDING_OPT_OUT_PING",
   3148                        },
   3149                      ],
   3150                    },
   3151                  },
   3152                },
   3153                {
   3154                  id: "crash-data",
   3155                  type: "checkbox",
   3156                  defaultValue: false,
   3157                  label: {
   3158                    string_id: "preonboarding-checklist-crash-reports-label",
   3159                  },
   3160                  description: {
   3161                    string_id:
   3162                      "preonboarding-checklist-crash-reports-description",
   3163                  },
   3164                  action: {
   3165                    type: "SET_PREF",
   3166                    data: {
   3167                      pref: {
   3168                        name: "browser.crashReports.unsubmittedCheck.autoSubmit2",
   3169                        value: true,
   3170                      },
   3171                    },
   3172                  },
   3173                  uncheckedAction: {
   3174                    type: "SET_PREF",
   3175                    data: {
   3176                      pref: {
   3177                        name: "browser.crashReports.unsubmittedCheck.autoSubmit2",
   3178                        value: false,
   3179                      },
   3180                    },
   3181                  },
   3182                },
   3183              ],
   3184            },
   3185          ],
   3186          primary_button: {
   3187            label: {
   3188              string_id: "preonboarding-primary-cta-v2",
   3189              marginBlock: "24px 0",
   3190            },
   3191            should_focus_button: true,
   3192            action: {
   3193              type: "MULTI_ACTION",
   3194              collectSelect: true,
   3195              data: {
   3196                orderedExecution: true,
   3197                actions: [
   3198                  {
   3199                    type: "SET_TERMS_OF_USE_INTERACTED",
   3200                  },
   3201                ],
   3202              },
   3203              dismiss: true,
   3204            },
   3205          },
   3206        },
   3207      },
   3208    ],
   3209  },
   3210 ];
   3211 
   3212 // Eventually, move Feature Callout messages to their own provider
   3213 const ONBOARDING_MESSAGES = () =>
   3214  BASE_MESSAGES().concat(FeatureCalloutMessages.getMessages());
   3215 
   3216 export const OnboardingMessageProvider = {
   3217  async getExtraAttributes() {
   3218    const [header, button_label] = await L10N.formatMessages([
   3219      { id: "onboarding-welcome-header" },
   3220      { id: "onboarding-start-browsing-button-label" },
   3221    ]);
   3222    return { header: header.value, button_label: button_label.value };
   3223  },
   3224 
   3225  async getMessages() {
   3226    const messages = await this.translateMessages(await ONBOARDING_MESSAGES());
   3227    OnboardingMessageProvider.getRestoredFromBackupMessage(messages);
   3228    return messages;
   3229  },
   3230 
   3231  getPreonboardingMessages() {
   3232    return PREONBOARDING_MESSAGES();
   3233  },
   3234 
   3235  // If the user has restored from a backup, mutate the restore from backup message to appear once per backup by using the restoration timestamp as the unique message id
   3236  getRestoredFromBackupMessage(messages) {
   3237    const backupRestorationTimestamp = Services.prefs.getIntPref(
   3238      "browser.backup.profile-restoration-date",
   3239      0
   3240    );
   3241 
   3242    if (backupRestorationTimestamp) {
   3243      for (const msg of messages) {
   3244        if (msg.id.startsWith("RESTORE_FROM_BACKUP")) {
   3245          msg.id += `_${backupRestorationTimestamp}`;
   3246          msg.content.id += `_${backupRestorationTimestamp}`;
   3247        }
   3248      }
   3249    }
   3250  },
   3251 
   3252  async getUntranslatedMessages() {
   3253    // This is helpful for jsonSchema testing - since we are localizing in the provider
   3254    const messages = await ONBOARDING_MESSAGES();
   3255    return messages;
   3256  },
   3257 
   3258  async translateMessages(messages) {
   3259    let translatedMessages = [];
   3260    for (const msg of messages) {
   3261      let translatedMessage = { ...msg };
   3262 
   3263      // If the message has no content, do not attempt to translate it
   3264      if (!translatedMessage.content) {
   3265        translatedMessages.push(translatedMessage);
   3266        continue;
   3267      }
   3268 
   3269      // Translate any secondary buttons separately
   3270      if (msg.content.secondary_button) {
   3271        const [secondary_button_string] = await L10N.formatMessages([
   3272          { id: msg.content.secondary_button.label.string_id },
   3273        ]);
   3274        translatedMessage.content.secondary_button.label =
   3275          secondary_button_string.value;
   3276      }
   3277      if (msg.content.header) {
   3278        const [header_string] = await L10N.formatMessages([
   3279          { id: msg.content.header.string_id },
   3280        ]);
   3281        translatedMessage.content.header = header_string.value;
   3282      }
   3283      translatedMessages.push(translatedMessage);
   3284    }
   3285    return translatedMessages;
   3286  },
   3287 
   3288  async _doesAppNeedPin(privateBrowsing = false) {
   3289    const needPin = await lazy.ShellService.doesAppNeedPin(privateBrowsing);
   3290    return needPin;
   3291  },
   3292 
   3293  async _doesAppNeedDefault() {
   3294    let checkDefault = Services.prefs.getBoolPref(
   3295      "browser.shell.checkDefaultBrowser",
   3296      false
   3297    );
   3298    let isDefault = await lazy.ShellService.isDefaultBrowser();
   3299    return checkDefault && !isDefault;
   3300  },
   3301 
   3302  _shouldShowPrivacySegmentationScreen() {
   3303    return Services.prefs.getBoolPref(
   3304      "browser.privacySegmentation.preferences.show"
   3305    );
   3306  },
   3307 
   3308  _doesHomepageNeedReset() {
   3309    return (
   3310      Services.prefs.prefHasUserValue(HOMEPAGE_PREF) ||
   3311      Services.prefs.prefHasUserValue(NEWTAB_PREF)
   3312    );
   3313  },
   3314 
   3315  async getUpgradeMessage() {
   3316    let message = (await OnboardingMessageProvider.getMessages()).find(
   3317      ({ id }) => id === "FX_MR_106_UPGRADE"
   3318    );
   3319 
   3320    let { content } = message;
   3321    // Helper to find screens and remove them where applicable.
   3322    function removeScreens(check) {
   3323      const { screens } = content;
   3324      for (let i = 0; i < screens?.length; i++) {
   3325        if (check(screens[i])) {
   3326          screens.splice(i--, 1);
   3327        }
   3328      }
   3329    }
   3330 
   3331    // Helper to prepare mobile download screen content
   3332    function prepareMobileDownload() {
   3333      let mobileContent = content.screens.find(
   3334        screen => screen.id === "UPGRADE_MOBILE_DOWNLOAD"
   3335      )?.content;
   3336 
   3337      if (!mobileContent) {
   3338        return;
   3339      }
   3340      if (!lazy.BrowserUtils.sendToDeviceEmailsSupported()) {
   3341        // If send to device emails are not supported for a user's locale,
   3342        // remove the send to device link and update the screen text
   3343        delete mobileContent.cta_paragraph.action;
   3344        mobileContent.cta_paragraph.text = {
   3345          string_id: "mr2022-onboarding-no-mobile-download-cta-text",
   3346        };
   3347      }
   3348      // Update CN specific QRCode url
   3349      if (lazy.BrowserUtils.isChinaRepack()) {
   3350        mobileContent.hero_image.url = `${mobileContent.hero_image.url.slice(
   3351          0,
   3352          mobileContent.hero_image.url.indexOf(".svg")
   3353        )}-cn.svg`;
   3354      }
   3355    }
   3356 
   3357    let pinScreen = content.screens?.find(
   3358      screen => screen.id === "UPGRADE_PIN_FIREFOX"
   3359    );
   3360    const needPin = await this._doesAppNeedPin();
   3361    const needDefault = await this._doesAppNeedDefault();
   3362    const needPrivatePin =
   3363      !lazy.hidePrivatePin && (await this._doesAppNeedPin(true));
   3364    const showSegmentation = this._shouldShowPrivacySegmentationScreen();
   3365 
   3366    //If a user has Firefox as default remove import screen
   3367    if (!needDefault) {
   3368      removeScreens(screen =>
   3369        screen.id?.startsWith("UPGRADE_IMPORT_SETTINGS_EMBEDDED")
   3370      );
   3371    }
   3372 
   3373    // If already pinned, convert "pin" screen to "welcome" with desired action.
   3374    let removeDefault = !needDefault;
   3375    // If user doesn't need pin, update screen to set "default" or "get started" configuration
   3376    if (!needPin && pinScreen) {
   3377      // don't need to show the checkbox
   3378      delete pinScreen.content.checkbox;
   3379 
   3380      removeDefault = true;
   3381      let primary = pinScreen.content.primary_button;
   3382      if (needDefault) {
   3383        pinScreen.id = "UPGRADE_ONLY_DEFAULT";
   3384        pinScreen.content.subtitle = {
   3385          string_id: "mr2022-onboarding-existing-set-default-only-subtitle",
   3386        };
   3387        primary.label.string_id =
   3388          "mr2022-onboarding-set-default-primary-button-label";
   3389 
   3390        // The "pin" screen will now handle "default" so remove other "default."
   3391        primary.action.type = "SET_DEFAULT_BROWSER";
   3392      } else {
   3393        pinScreen.id = "UPGRADE_GET_STARTED";
   3394        pinScreen.content.subtitle = {
   3395          string_id: "mr2022-onboarding-get-started-primary-subtitle",
   3396        };
   3397        primary.label = {
   3398          string_id: "mr2022-onboarding-get-started-primary-button-label",
   3399        };
   3400        delete primary.action.type;
   3401      }
   3402    }
   3403 
   3404    // If a user has Firefox private pinned remove pin private window screen
   3405    // We also remove standalone pin private window screen if a user doesn't have
   3406    // Firefox pinned in which case the option is shown as checkbox with UPGRADE_PIN_FIREFOX screen
   3407    if (!needPrivatePin || needPin) {
   3408      removeScreens(screen =>
   3409        screen.id?.startsWith("UPGRADE_PIN_PRIVATE_WINDOW")
   3410      );
   3411    }
   3412 
   3413    if (!showSegmentation) {
   3414      removeScreens(screen =>
   3415        screen.id?.startsWith("UPGRADE_DATA_RECOMMENDATION")
   3416      );
   3417    }
   3418 
   3419    //If privatePin, remove checkbox from pinscreen
   3420    if (!needPrivatePin) {
   3421      delete content.screens?.find(
   3422        screen => screen.id === "UPGRADE_PIN_FIREFOX"
   3423      )?.content?.checkbox;
   3424    }
   3425 
   3426    if (removeDefault) {
   3427      removeScreens(screen => screen.id?.startsWith("UPGRADE_SET_DEFAULT"));
   3428    }
   3429 
   3430    // Remove mobile download screen if user has sync enabled
   3431    if (lazy.usesFirefoxSync && lazy.mobileDevices > 0) {
   3432      removeScreens(screen => screen.id === "UPGRADE_MOBILE_DOWNLOAD");
   3433    } else {
   3434      prepareMobileDownload();
   3435    }
   3436 
   3437    return message;
   3438  },
   3439 };