tor-browser

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

shims.js (27955B)


      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 "use strict";
      6 
      7 /* globals module, require */
      8 
      9 const AVAILABLE_SHIMS = [
     10  {
     11    id: "AddThis",
     12    platform: "all",
     13    name: "AddThis",
     14    bug: "1713694",
     15    file: "addthis-angular.js",
     16    matches: [
     17      "*://s7.addthis.com/icons/official-addthis-angularjs/current/dist/official-addthis-angularjs.min.js*",
     18    ],
     19    onlyIfBlockedByETP: true,
     20  },
     21  {
     22    id: "Adform",
     23    platform: "all",
     24    name: "Adform",
     25    bug: "1713695",
     26    file: "adform.js",
     27    matches: [
     28      "*://track.adform.net/serving/scripts/trackpoint/",
     29      "*://track.adform.net/serving/scripts/trackpoint/async/",
     30      {
     31        patterns: ["*://track.adform.net/Serving/TrackPoint/*"],
     32        target: "tracking-pixel.png",
     33        types: ["image", "imageset", "xmlhttprequest"],
     34      },
     35    ],
     36    onlyIfBlockedByETP: true,
     37  },
     38  {
     39    id: "AdNexusAST",
     40    platform: "all",
     41    name: "AdNexus AST",
     42    bug: "1734130",
     43    file: "adnexus-ast.js",
     44    matches: ["*://*.adnxs.com/*/ast.js*"],
     45    onlyIfBlockedByETP: true,
     46  },
     47  {
     48    id: "AdNexusPrebid",
     49    platform: "all",
     50    name: "AdNexus Prebid",
     51    bug: "1713696",
     52    file: "adnexus-prebid.js",
     53    matches: ["*://*.adnxs.com/*/pb.js*", "*://*.adnxs.com/*/prebid*"],
     54    onlyIfBlockedByETP: true,
     55  },
     56  {
     57    id: "AdobeEverestJS",
     58    platform: "all",
     59    name: "Adobe EverestJS",
     60    bug: "1728114",
     61    file: "everest.js",
     62    matches: ["*://www.everestjs.net/static/st.v3.js*"],
     63    onlyIfBlockedByETP: true,
     64  },
     65  {
     66    // keep this above AdSafeProtectedTrackingPixels
     67    id: "AdSafeProtectedGoogleIMAAdapter",
     68    platform: "all",
     69    name: "Ad Safe Protected Google IMA Adapter",
     70    bug: "1508639",
     71    file: "adsafeprotected-ima.js",
     72    matches: ["*://static.adsafeprotected.com/vans-adapter-google-ima.js"],
     73    onlyIfBlockedByETP: true,
     74  },
     75  {
     76    id: "AdsByGoogle",
     77    platform: "all",
     78    name: "Ads by Google",
     79    bug: "1713726",
     80    file: "google-ads.js",
     81    matches: [
     82      "*://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
     83      {
     84        patterns: [
     85          "*://pagead2.googlesyndication.com/pagead/*.js*fcd=true",
     86          "*://pagead2.googlesyndication.com/pagead/js/*.js*fcd=true",
     87        ],
     88        target: "empty-script.js",
     89        types: ["xmlhttprequest"],
     90      },
     91    ],
     92    onlyIfBlockedByETP: true,
     93  },
     94  {
     95    id: "AdvertisingCom",
     96    platform: "all",
     97    name: "advertising.com",
     98    bug: "1701685",
     99    matches: [
    100      {
    101        patterns: ["*://pixel.advertising.com/firefox-etp"],
    102        target: "tracking-pixel.png",
    103        types: ["image", "imageset", "xmlhttprequest"],
    104        onlyIfBlockedByETP: true,
    105      },
    106      {
    107        patterns: ["*://cdn.cmp.advertising.com/firefox-etp"],
    108        target: "empty-script.js",
    109        types: ["xmlhttprequest"],
    110        onlyIfBlockedByETP: true,
    111      },
    112      {
    113        patterns: ["*://*.advertising.com/*.js*"],
    114        target: "https://cdn.cmp.advertising.com/firefox-etp",
    115        types: ["image", "imageset", "xmlhttprequest"],
    116        onlyIfBlockedByETP: true,
    117      },
    118      {
    119        patterns: ["*://*.advertising.com/*"],
    120        target: "https://pixel.advertising.com/firefox-etp",
    121        types: ["image", "imageset", "xmlhttprequest"],
    122        onlyIfBlockedByETP: true,
    123      },
    124    ],
    125  },
    126  {
    127    id: "Branch",
    128    platform: "all",
    129    name: "Branch Web SDK",
    130    bug: "1716220",
    131    file: "branch.js",
    132    matches: ["*://cdn.branch.io/branch-latest.min.js*"],
    133    onlyIfBlockedByETP: true,
    134  },
    135  {
    136    id: "DoubleVerify",
    137    platform: "all",
    138    name: "DoubleVerify",
    139    bug: "1771557",
    140    file: "doubleverify.js",
    141    matches: ["*://pub.doubleverify.com/signals/pub.js*"],
    142    onlyIfBlockedByETP: true,
    143  },
    144  {
    145    id: "AmazonTAM",
    146    platform: "all",
    147    name: "Amazon Transparent Ad Marketplace",
    148    bug: "1713698",
    149    file: "apstag.js",
    150    matches: ["*://c.amazon-adsystem.com/aax2/apstag.js"],
    151    onlyIfBlockedByETP: true,
    152  },
    153  {
    154    id: "AmazonAdSystem",
    155    platform: "all",
    156    name: "Amazon Ad System",
    157    bug: "1977375",
    158    file: "empty-shim.txt",
    159    matches: ["*://aax.amazon-adsystem.com/e/dtb/bid/*/prebid*"],
    160    onlyIfBlockedByETP: true,
    161  },
    162  {
    163    id: "ArtstationLogin",
    164    platform: "all",
    165    name: "Artstation Google Login",
    166    bug: "1926551",
    167    contentScripts: [
    168      {
    169        js: "artstationLogin.js",
    170        matches: ["*://www.artstation.com/*"],
    171        runAt: "document_start",
    172      },
    173    ],
    174    onlyIfDFPIActive: true,
    175  },
    176  {
    177    id: "BmAuth",
    178    platform: "all",
    179    name: "BmAuth by 9c9media",
    180    bug: "1486337",
    181    file: "bmauth.js",
    182    matches: ["*://auth.9c9media.ca/auth/main.js"],
    183    onlyIfBlockedByETP: true,
    184  },
    185  {
    186    id: "Chartbeat",
    187    platform: "all",
    188    name: "Chartbeat",
    189    bug: "1713699",
    190    file: "chartbeat.js",
    191    matches: [
    192      "*://static.chartbeat.com/js/chartbeat.js",
    193      "*://static.chartbeat.com/js/chartbeat_video.js",
    194    ],
    195    onlyIfBlockedByETP: true,
    196  },
    197  {
    198    id: "Criteo",
    199    platform: "all",
    200    name: "Criteo",
    201    bug: "1713720",
    202    file: "criteo.js",
    203    matches: ["*://static.criteo.net/js/ld/publishertag.js"],
    204    onlyIfBlockedByETP: true,
    205  },
    206  {
    207    // keep this above AdSafeProtectedTrackingPixels
    208    id: "Doubleclick",
    209    platform: "all",
    210    name: "Doubleclick",
    211    bug: "1713693",
    212    matches: [
    213      {
    214        patterns: [
    215          "*://securepubads.g.doubleclick.net/gampad/*ad-blk*",
    216          "*://pubads.g.doubleclick.net/gampad/*ad-blk*",
    217        ],
    218        target: "empty-shim.txt",
    219        types: ["image", "imageset", "xmlhttprequest"],
    220      },
    221      {
    222        patterns: [
    223          "*://securepubads.g.doubleclick.net/gampad/*xml_vmap1*",
    224          "*://pubads.g.doubleclick.net/gampad/*xml_vmap1*",
    225        ],
    226        target: "vmad.xml",
    227        types: ["image", "imageset", "xmlhttprequest"],
    228      },
    229      {
    230        patterns: [
    231          "*://vast.adsafeprotected.com/vast*",
    232          "*://securepubads.g.doubleclick.net/gampad/*xml_vmap2*",
    233          "*://pubads.g.doubleclick.net/gampad/*xml_vmap2*",
    234        ],
    235        target: "vast2.xml",
    236        types: ["image", "imageset", "xmlhttprequest"],
    237      },
    238      {
    239        patterns: [
    240          "*://securepubads.g.doubleclick.net/gampad/*ad*",
    241          "*://pubads.g.doubleclick.net/gampad/*ad*",
    242        ],
    243        target: "vast3.xml",
    244        types: ["image", "imageset", "xmlhttprequest"],
    245      },
    246    ],
    247    onlyIfBlockedByETP: true,
    248  },
    249  {
    250    id: "Eluminate",
    251    platform: "all",
    252    name: "Eluminate",
    253    bug: "1503211",
    254    file: "eluminate.js",
    255    matches: ["*://libs.coremetrics.com/eluminate.js"],
    256    onlyIfBlockedByETP: true,
    257  },
    258  {
    259    id: "FacebookSDK",
    260    platform: "all",
    261    branches: ["nightly:android"],
    262    name: "Facebook SDK",
    263    bug: "1226498",
    264    file: "facebook-sdk.js",
    265    logos: ["facebook.svg", "play.svg"],
    266    matches: [
    267      "*://connect.facebook.net/*/sdk.js*",
    268      "*://connect.facebook.net/*/all.js*",
    269      {
    270        patterns: ["*://www.facebook.com/platform/impression.php*"],
    271        target: "tracking-pixel.png",
    272        types: ["image", "imageset", "xmlhttprequest"],
    273      },
    274    ],
    275    needsShimHelpers: ["optIn", "getOptions"],
    276    onlyIfBlockedByETP: true,
    277    unblocksOnOptIn: [
    278      "*://connect.facebook.net/*/sdk.js*",
    279      "*://connect.facebook.net/*/all.js*",
    280      "*://*.xx.fbcdn.net/*", // covers:
    281      // "*://scontent-.*-\d.xx.fbcdn.net/*",
    282      // "*://static.xx.fbcdn.net/rsrc.php/*",
    283      "*://graph.facebook.com/v2*access_token*",
    284      "*://graph.facebook.com/v*/me*",
    285      "*://graph.facebook.com/*/picture*",
    286      "*://www.facebook.com/*/plugins/login_button.php*",
    287      "*://www.facebook.com/x/oauth/status*",
    288      {
    289        patterns: [
    290          "*://www.facebook.com/*/plugins/video.php*",
    291          "*://www.facebook.com/rsrc.php/*",
    292        ],
    293        branches: ["nightly"],
    294      },
    295    ],
    296  },
    297  {
    298    id: "Fastclick",
    299    platform: "all",
    300    name: "Fastclick",
    301    bug: "1738220",
    302    file: "fastclick.js",
    303    matches: [
    304      "*://secure.cdn.fastclick.net/js/cnvr-launcher/*/launcher-stub.min.js*",
    305    ],
    306    onlyIfBlockedByETP: true,
    307  },
    308  {
    309    id: "figshare",
    310    platform: "all",
    311    name: "Figshare",
    312    bug: "1895990",
    313    contentScripts: [
    314      {
    315        js: "figshare.js",
    316        matches: [
    317          "*://*.figsharelabs.io/*",
    318          "*://opal.latrobe.edu.au/*",
    319          "*://repository.lboro.ac.uk/*",
    320          "*://portal.sds.ox.ac.uk/*",
    321          "*://curate.nd.edu/*",
    322          "*://kilthub.cmu.edu/*",
    323          "*://publications.cispa.de/*",
    324        ],
    325        runAt: "document_start",
    326      },
    327    ],
    328    onlyIfDFPIActive: true,
    329  },
    330  {
    331    id: "GoogleAnalyticsAndTagManager",
    332    platform: "all",
    333    name: "Google Analytics and Tag Manager",
    334    bug: "1713687",
    335    file: "google-analytics-and-tag-manager.js",
    336    matches: [
    337      "*://www.google-analytics.com/analytics.js*",
    338      "*://www.google-analytics.com/gtm/js*",
    339      "*://www.googletagmanager.com/gtm.js*",
    340    ],
    341    onlyIfBlockedByETP: true,
    342  },
    343  {
    344    id: "GoogleAnalyticsECommercePlugin",
    345    platform: "all",
    346    name: "Google Analytics E-Commerce Plugin",
    347    bug: "1620533",
    348    file: "google-analytics-ecommerce-plugin.js",
    349    matches: ["*://www.google-analytics.com/plugins/ua/ec.js"],
    350    onlyIfBlockedByETP: true,
    351  },
    352  {
    353    id: "GoogleAnalyticsLegacy",
    354    platform: "all",
    355    name: "Google Analytics (legacy version)",
    356    bug: "1487072",
    357    file: "google-analytics-legacy.js",
    358    matches: ["*://ssl.google-analytics.com/ga.js"],
    359    onlyIfBlockedByETP: true,
    360  },
    361  {
    362    id: "GoogleIMA",
    363    platform: "all",
    364    name: "Google Interactive Media Ads",
    365    bug: "1713690",
    366    file: "google-ima.js",
    367    matches: [
    368      "*://s0.2mdn.net/instream/html5/ima3.js",
    369      "*://imasdk.googleapis.com/js/sdkloader/ima3.js",
    370    ],
    371    onlyIfBlockedByETP: true,
    372  },
    373  {
    374    id: "GooglePageAd",
    375    platform: "all",
    376    name: "Google Page Ad",
    377    bug: "1713692",
    378    file: "google-page-ad.js",
    379    matches: ["*://www.googleadservices.com/pagead/conversion_async.js"],
    380    onlyIfBlockedByETP: true,
    381  },
    382  {
    383    id: "GooglePublisherTags",
    384    platform: "all",
    385    name: "Google Publisher Tags",
    386    bug: "1713685",
    387    file: "google-publisher-tags.js",
    388    notHosts: [
    389      "13wham.com",
    390      "wpde.com",
    391      "krcrtv.com",
    392      "nbcmontana.com",
    393      "idahonews.com",
    394      "wgme.com",
    395      "wtov9.com",
    396      "news3lv.com",
    397      "devuploads.com",
    398      "wjla.com",
    399      "komonews.com",
    400      "fox11online.com",
    401      "cbs6albany.com",
    402      "okcfox.co",
    403      "turnto10.com",
    404      "wcti12.com",
    405      "wjactv.com",
    406      "keprtv.com",
    407      "katu.com",
    408      "kfoxtv.com",
    409      "thenationaldesk.com",
    410      "foxbaltimore.com",
    411      "local12.com",
    412    ],
    413    matches: [
    414      "*://www.googletagservices.com/tag/js/gpt.js*",
    415      "*://pagead2.googlesyndication.com/tag/js/gpt.js*",
    416      "*://pagead2.googlesyndication.com/gpt/pubads_impl_*.js*",
    417      "*://securepubads.g.doubleclick.net/tag/js/gpt.js*",
    418      "*://securepubads.g.doubleclick.net/gpt/pubads_impl_*.js*",
    419    ],
    420    onlyIfBlockedByETP: true,
    421  },
    422  {
    423    id: "GoogleTrends",
    424    platform: "all",
    425    name: "Google Trends",
    426    bug: "1624914",
    427    custom: "google-trends-dfpi-fix",
    428    onlyIfDFPIActive: true,
    429    matches: [
    430      {
    431        patterns: ["*://trends.google.com/trends/embed*"],
    432        types: ["sub_frame"],
    433      },
    434    ],
    435  },
    436  {
    437    id: "IAM",
    438    platform: "all",
    439    name: "INFOnline IAM",
    440    bug: "1761774",
    441    file: "iam.js",
    442    matches: ["*://script.ioam.de/iam.js"],
    443    onlyIfBlockedByETP: true,
    444  },
    445  {
    446    // keep this above AdSafeProtectedTrackingPixels
    447    id: "IASPET",
    448    platform: "all",
    449    name: "Integral Ad Science PET",
    450    bug: "1713701",
    451    file: "iaspet.js",
    452    matches: [
    453      "*://cdn.adsafeprotected.com/iasPET.1.js",
    454      "*://static.adsafeprotected.com/iasPET.1.js",
    455    ],
    456    onlyIfBlockedByETP: true,
    457  },
    458  {
    459    id: "MNet",
    460    platform: "all",
    461    name: "Media.net Ads",
    462    bug: "1713703",
    463    file: "empty-script.js",
    464    matches: ["*://adservex.media.net/videoAds.js*"],
    465    onlyIfBlockedByETP: true,
    466  },
    467  {
    468    id: "Moat",
    469    platform: "all",
    470    name: "Moat",
    471    bug: "1713704",
    472    file: "moat.js",
    473    matches: [
    474      "*://*.moatads.com/*/moatad.js*",
    475      "*://*.moatads.com/*/moatapi.js*",
    476      "*://*.moatads.com/*/moatheader.js*",
    477      "*://*.moatads.com/*/yi.js*",
    478    ],
    479    onlyIfBlockedByETP: true,
    480  },
    481  {
    482    id: "Nielsen",
    483    platform: "all",
    484    name: "Nielsen",
    485    bug: "1760754",
    486    file: "nielsen.js",
    487    matches: ["*://*.imrworldwide.com/v60.js"],
    488    onlyIfBlockedByETP: true,
    489  },
    490  {
    491    id: "Optimizely",
    492    platform: "all",
    493    name: "Optimizely",
    494    bug: "1714431",
    495    file: "optimizely.js",
    496    matches: [
    497      "*://cdn.optimizely.com/js/*.js",
    498      "*://cdn.optimizely.com/public/*.js",
    499    ],
    500    onlyIfBlockedByETP: true,
    501  },
    502  {
    503    id: "Rambler",
    504    platform: "all",
    505    name: "Rambler Authenticator",
    506    bug: "1606428",
    507    file: "rambler-authenticator.js",
    508    matches: ["*://id.rambler.ru/rambler-id-helper/auth_events.js"],
    509    needsShimHelpers: ["optIn"],
    510    onlyIfBlockedByETP: true,
    511  },
    512  {
    513    id: "RichRelevance",
    514    platform: "all",
    515    name: "Rich Relevance",
    516    bug: "1713725",
    517    file: "rich-relevance.js",
    518    matches: ["*://media.richrelevance.com/rrserver/js/1.2/p13n.js"],
    519    onlyIfBlockedByETP: true,
    520  },
    521  {
    522    id: "Firebase",
    523    platform: "all",
    524    name: "Firebase",
    525    bug: "1771783",
    526    onlyIfPrivateBrowsing: true,
    527    runFirst: "firebase.js",
    528    matches: [
    529      // bugs 1750699, 1767407
    530      "*://www.gstatic.com/firebasejs/*/firebase-messaging.js*",
    531    ],
    532    contentScripts: [
    533      {
    534        js: "firebase.js",
    535        runAt: "document_start",
    536        matches: [
    537          "*://www.homedepot.ca/*", // bug 1778993
    538          "*://orangerie.eu/*", // bug 1758442
    539          "*://web.whatsapp.com/*", // bug 1767407
    540          "*://www.tripadvisor.com/*", // bug 1779536
    541          "*://www.office.com/*", // bug 1783921
    542        ],
    543      },
    544    ],
    545  },
    546  {
    547    id: "StickyAdsTV",
    548    platform: "all",
    549    name: "StickyAdsTV",
    550    bug: "1717806",
    551    matches: [
    552      {
    553        patterns: ["https://ads.stickyadstv.com/firefox-etp"],
    554        target: "tracking-pixel.png",
    555        types: ["image", "imageset", "xmlhttprequest"],
    556        onlyIfBlockedByETP: true,
    557      },
    558      {
    559        patterns: [
    560          "*://ads.stickyadstv.com/auto-user-sync*",
    561          "*://ads.stickyadstv.com/user-matching*",
    562        ],
    563        target: "https://ads.stickyadstv.com/firefox-etp",
    564        types: ["image", "imageset", "xmlhttprequest"],
    565        onlyIfBlockedByETP: true,
    566      },
    567    ],
    568  },
    569  {
    570    id: "Kinja",
    571    platform: "all",
    572    name: "Kinja",
    573    bug: "1656171",
    574    contentScripts: [
    575      {
    576        js: "kinja.js",
    577        matches: [
    578          "*://www.avclub.com/*",
    579          "*://deadspin.com/*",
    580          "*://gizmodo.com/*",
    581          "*://jalopnik.com/*",
    582          "*://jezebel.com/*",
    583          "*://kotaku.com/*",
    584          "*://lifehacker.com/*",
    585          "*://www.theonion.com/*",
    586          "*://www.theroot.com/*",
    587          "*://thetakeout.com/*",
    588          "*://theinventory.com/*",
    589        ],
    590        runAt: "document_start",
    591        allFrames: true,
    592      },
    593    ],
    594    onlyIfDFPIActive: true,
    595  },
    596  {
    597    id: "MessengerLogin",
    598    platform: "desktop",
    599    name: "Messenger Login",
    600    bug: "1934814",
    601    needsShimHelpers: ["checkFacebookLoginStatus"],
    602    contentScripts: [
    603      {
    604        js: "messengerLogin.js",
    605        matches: ["*://www.messenger.com/*"],
    606        runAt: "document_start",
    607      },
    608    ],
    609    onlyIfDFPIActive: true,
    610  },
    611  {
    612    id: "MicrosoftIcon",
    613    name: "Microsoft Account Icon",
    614    bug: "1728111",
    615    contentScripts: [
    616      {
    617        js: "microsoftAccountIcon.js",
    618        matches: ["*://*.microsoft.com/*", "*://m365.cloud.microsoft/*"],
    619        runAt: "document_start",
    620      },
    621    ],
    622    onlyIfDFPIActive: true,
    623  },
    624  {
    625    id: "MicrosoftLogin",
    626    platform: "desktop",
    627    name: "Microsoft Login",
    628    bug: "1638383",
    629    requestStorageAccessForRedirect: [
    630      ["*://web.powerva.microsoft.com/*", "*://login.microsoftonline.com/*"],
    631      ["*://teams.microsoft.com/*", "*://login.microsoftonline.com/*"],
    632      ["*://*.teams.microsoft.us/*", "*://login.microsoftonline.us/*"],
    633      ["*://www.msn.com/*", "*://login.microsoftonline.com/*"],
    634      ["*://support.microsoft.com/*", "*://login.microsoftonline.com/*"],
    635      ["*://answers.microsoft.com/*", "*://login.microsoftonline.com/*"],
    636    ],
    637    contentScripts: [
    638      {
    639        js: "microsoftLogin.js",
    640        matches: [
    641          "*://web.powerva.microsoft.com/*",
    642          "*://teams.microsoft.com/*",
    643          "*://*.teams.microsoft.us/*",
    644          "*://www.msn.com/*",
    645          "*://support.microsoft.com/*",
    646          "*://answers.microsoft.com/*",
    647        ],
    648        runAt: "document_start",
    649      },
    650    ],
    651    onlyIfDFPIActive: true,
    652  },
    653  {
    654    id: "CambridgeDictionaryLogin",
    655    platform: "all",
    656    name: "Cambridge Dictionary Google Login",
    657    bug: "1993727",
    658    contentScripts: [
    659      {
    660        js: "cambridgeDictionaryLogin.js",
    661        matches: ["*://dictionary.cambridge.org/*"],
    662        runAt: "document_start",
    663      },
    664    ],
    665    onlyIfDFPIActive: true,
    666  },
    667  {
    668    id: "MicrosoftOfficeAuth",
    669    platform: "desktop",
    670    name: "Microsoft Office Auth",
    671    bug: "1747889",
    672    contentScripts: [
    673      {
    674        js: "microsoftOfficeAuth.js",
    675        matches: [
    676          "*://usc-excel.officeapps.live.com/*",
    677          "*://excel.officeapps.live.com/*",
    678        ],
    679        runAt: "document_start",
    680        allFrames: true,
    681      },
    682    ],
    683  },
    684  {
    685    id: "MicrosoftVirtualAssistant",
    686    platform: "all",
    687    name: "Microsoft Virtual Assistant",
    688    bug: "1801277",
    689    contentScripts: [
    690      {
    691        js: "microsoftVirtualAssistant.js",
    692        matches: ["*://publisher.liveperson.net/*"],
    693        runAt: "document_start",
    694        allFrames: true,
    695      },
    696    ],
    697  },
    698  {
    699    id: "History",
    700    platform: "all",
    701    name: "History.com",
    702    bug: "1624853",
    703    contentScripts: [
    704      {
    705        js: "history.js",
    706        matches: ["*://play.history.com/*"],
    707        runAt: "document_start",
    708      },
    709    ],
    710    onlyIfDFPIActive: true,
    711  },
    712  {
    713    id: "Crave.ca",
    714    platform: "all",
    715    name: "Crave.ca",
    716    bug: "1746439",
    717    contentScripts: [
    718      {
    719        js: "crave-ca.js",
    720        matches: ["*://account.bellmedia.ca/login*service=crave*"],
    721        runAt: "document_start",
    722      },
    723    ],
    724    onlyIfDFPIActive: true,
    725  },
    726  {
    727    id: "Instagram.com",
    728    platform: "android",
    729    name: "Instagram.com",
    730    bug: "1804445",
    731    contentScripts: [
    732      {
    733        js: "instagram.js",
    734        matches: ["*://www.instagram.com/*"],
    735        runAt: "document_start",
    736      },
    737    ],
    738    onlyIfDFPIActive: true,
    739  },
    740  {
    741    id: "MaxMindGeoIP",
    742    platform: "all",
    743    name: "MaxMind GeoIP",
    744    bug: "1754389",
    745    file: "maxmind-geoip.js",
    746    matches: ["*://js.maxmind.com/js/apis/geoip2/*/geoip2.js"],
    747    onlyIfBlockedByETP: true,
    748  },
    749  {
    750    id: "WebTrends",
    751    platform: "all",
    752    name: "WebTrends",
    753    bug: "1766414",
    754    file: "webtrends.js",
    755    matches: [
    756      "*://s.webtrends.com/js/advancedLinkTracking.js",
    757      "*://s.webtrends.com/js/webtrends.js",
    758      "*://s.webtrends.com/js/webtrends.min.js",
    759    ],
    760    onlyIfBlockedByETP: true,
    761  },
    762  {
    763    // keep this below any other shims checking adsafeprotected URLs
    764    id: "AdSafeProtectedTrackingPixels",
    765    platform: "all",
    766    name: "Ad Safe Protected tracking pixels",
    767    bug: "1717806",
    768    matches: [
    769      {
    770        patterns: ["https://static.adsafeprotected.com/firefox-etp-pixel"],
    771        target: "tracking-pixel.png",
    772        types: ["image", "imageset", "xmlhttprequest"],
    773      },
    774      {
    775        patterns: ["https://static.adsafeprotected.com/firefox-etp-js"],
    776        target: "empty-script.js",
    777        types: ["xmlhttprequest"],
    778      },
    779      {
    780        patterns: [
    781          "*://*.adsafeprotected.com/*.gif*",
    782          "*://*.adsafeprotected.com/*.png*",
    783        ],
    784        target: "https://static.adsafeprotected.com/firefox-etp-pixel",
    785        types: ["image", "imageset", "xmlhttprequest"],
    786        onlyIfBlockedByETP: true,
    787      },
    788      {
    789        patterns: [
    790          "*://*.adsafeprotected.com/*.js*",
    791          "*://*.adsafeprotected.com/*/adj*",
    792          "*://*.adsafeprotected.com/*/imp/*",
    793          "*://*.adsafeprotected.com/*/Serving/*",
    794          "*://*.adsafeprotected.com/*/unit/*",
    795          "*://*.adsafeprotected.com/jload",
    796          "*://*.adsafeprotected.com/jload?*",
    797          "*://*.adsafeprotected.com/jsvid",
    798          "*://*.adsafeprotected.com/jsvid?*",
    799          "*://*.adsafeprotected.com/mon*",
    800          "*://*.adsafeprotected.com/tpl",
    801          "*://*.adsafeprotected.com/tpl?*",
    802          "*://*.adsafeprotected.com/services/pub*",
    803        ],
    804        target: "https://static.adsafeprotected.com/firefox-etp-js",
    805        types: ["image", "imageset", "xmlhttprequest"],
    806        onlyIfBlockedByETP: true,
    807      },
    808      {
    809        // note, fallback case seems to be an image
    810        patterns: ["*://*.adsafeprotected.com/*"],
    811        target: "https://static.adsafeprotected.com/firefox-etp-pixel",
    812        types: ["image", "imageset", "xmlhttprequest"],
    813        onlyIfBlockedByETP: true,
    814      },
    815    ],
    816  },
    817  {
    818    id: "SpotifyEmbed",
    819    platform: "all",
    820    name: "SpotifyEmbed",
    821    bug: "1792395",
    822    contentScripts: [
    823      {
    824        js: "spotify-embed.js",
    825        matches: ["*://open.spotify.com/embed/*"],
    826        runAt: "document_start",
    827        allFrames: true,
    828      },
    829    ],
    830    onlyIfDFPIActive: true,
    831  },
    832  {
    833    id: "tsn.ca",
    834    platform: "all",
    835    name: "tsn.ca login",
    836    bug: "1802340",
    837    contentScripts: [
    838      {
    839        js: "tsn-ca.js",
    840        matches: ["*://account.bellmedia.ca/login*service=tsn*"],
    841        runAt: "document_start",
    842      },
    843    ],
    844    onlyIfDFPIActive: true,
    845  },
    846  {
    847    id: "StackOverflowLogin",
    848    platform: "all",
    849    name: "StackOverflow Login",
    850    bug: "1949491",
    851    contentScripts: [
    852      {
    853        js: "stackoverflow-login.js",
    854        matches: ["*://stackoverflow.com/*"],
    855        runAt: "document_start",
    856      },
    857    ],
    858    onlyIfDFPIActive: true,
    859  },
    860  {
    861    id: "JiraZendeskSupport",
    862    platform: "all",
    863    name: "Jira Zendesk Support",
    864    bug: "1774592",
    865    contentScripts: [
    866      {
    867        js: "jira-zendesk-support.js",
    868        matches: ["*://*.atlassian.net/*"],
    869        runAt: "document_start",
    870      },
    871    ],
    872    onlyIfDFPIActive: true,
    873  },
    874  {
    875    id: "ZendeskAsanaSupport",
    876    platform: "all",
    877    name: "Zendesk Asana Support",
    878    bug: "1774567",
    879    contentScripts: [
    880      {
    881        js: "zendesk-asana-support.js",
    882        matches: ["*://*.zendesk.com/*"],
    883        runAt: "document_start",
    884      },
    885    ],
    886    onlyIfDFPIActive: true,
    887  },
    888  {
    889    id: "emeraude.my.salesforce.com",
    890    platform: "all",
    891    name: "Salesforce IndexedDB Script Access",
    892    bug: "1855139",
    893    contentScripts: [
    894      {
    895        js: "salesforce.js",
    896        matches: ["*://emeraude.my.salesforce.com/*"],
    897        runAt: "document_start",
    898        allFrames: true,
    899      },
    900    ],
    901  },
    902  {
    903    id: "InstagramEmbed",
    904    platform: "desktop",
    905    name: "Instagram embed placeholder",
    906    bug: "1892173",
    907    runFirst: "instagram-embed.js",
    908    // Blank stub file just so we run the script above when the matched script
    909    // files get blocked.
    910    file: "empty-script.js",
    911    matches: [
    912      "https://www.instagram.com/embed.js",
    913      "https://platform.instagram.com/*/embeds.js",
    914    ],
    915    logos: ["instagram.svg"],
    916    webExposedShimHelpers: [],
    917    needsShimHelpers: [
    918      "embedClicked",
    919      "smartblockEmbedReplaced",
    920      "smartblockGetFluentString",
    921    ],
    922    isSmartblockEmbedShim: true,
    923    onlyIfBlockedByETP: true,
    924    unblocksOnOptIn: [
    925      "*://www.instagram.com/*",
    926      "*://platform.instagram.com/*",
    927      "*://*.fbcdn.net/*",
    928    ],
    929  },
    930  {
    931    id: "TiktokEmbed",
    932    platform: "desktop",
    933    name: "Tiktok embed placeholder",
    934    bug: "1892172",
    935    runFirst: "tiktok-embed.js",
    936    // Blank stub file just so we run the script above when the matched script
    937    // files get blocked.
    938    file: "empty-script.js",
    939    matches: ["https://www.tiktok.com/embed.js"],
    940    logos: ["tiktok.svg"],
    941    webExposedShimHelpers: [],
    942    needsShimHelpers: [
    943      "embedClicked",
    944      "smartblockEmbedReplaced",
    945      "smartblockGetFluentString",
    946    ],
    947    isSmartblockEmbedShim: true,
    948    onlyIfBlockedByETP: true,
    949    unblocksOnOptIn: ["*://www.tiktok.com/*"],
    950  },
    951  {
    952    id: "DisqusEmbed",
    953    platform: "desktop",
    954    name: "Disqus embed placeholder",
    955    bug: "1965307",
    956    runFirst: "disqus-embed.js",
    957    // Blank stub file just so we run the script above when the matched script
    958    // files get blocked.
    959    file: "empty-script.js",
    960    matches: ["*://*.disqus.com/embed.js"],
    961    logos: ["disqus.svg"],
    962    webExposedShimHelpers: [],
    963    needsShimHelpers: [
    964      "embedClicked",
    965      "smartblockEmbedReplaced",
    966      "smartblockGetFluentString",
    967    ],
    968    isSmartblockEmbedShim: true,
    969    onlyIfBlockedByETP: true,
    970    unblocksOnOptIn: ["*://*.disqus.com/*", "*://c.disquscdn.com/*"],
    971  },
    972  {
    973    id: "FingerpringJSBotd",
    974    platform: "all",
    975    name: "FingerprintJS Bot Detection",
    976    bug: "1925995",
    977    file: "botd.mjs",
    978    matches: ["*://openfpcdn.io/botd/v1"],
    979    onlyIfBlockedByETP: true,
    980  },
    981  {
    982    id: "SteamLogin",
    983    platform: "all",
    984    name: "Steam Login Shim",
    985    bug: "1938299",
    986    requestStorageAccessForRedirect: [
    987      // allow cookies for *.steampowered.com <-> steamcommunity.com
    988      ["*://store.steampowered.com/*", "*://steamcommunity.com/*"],
    989      ["*://steamcommunity.com/*", "*://store.steampowered.com/*"],
    990      ["*://help.steampowered.com/*", "*://steamcommunity.com/*"],
    991      ["*://steamcommunity.com/*", "*://help.steampowered.com/*"],
    992      ["*://checkout.steampowered.com/*", "*://steamcommunity.com/*"],
    993      ["*://steamcommunity.com/*", "*://checkout.steampowered.com/*"],
    994      // allow cookies for *.steampowered.com <-> steam.tv
    995      ["*://store.steampowered.com/*", "*://steam.tv/*"],
    996      ["*://steam.tv/*", "*://store.steampowered.com/*"],
    997      ["*://help.steampowered.com/*", "*://steam.tv/*"],
    998      ["*://steam.tv/*", "*://help.steampowered.com/*"],
    999      ["*://checkout.steampowered.com/*", "*://steam.tv/*"],
   1000      ["*://steam.tv/*", "*://checkout.steampowered.com/*"],
   1001    ],
   1002  },
   1003  {
   1004    id: "TwitterEmbed",
   1005    platform: "desktop",
   1006    name: "Twitter embed placeholder",
   1007    bug: "1901602",
   1008    runFirst: "twitter-embed.js",
   1009    // Blank stub file just so we run the script above when the matched script
   1010    // files get blocked.
   1011    file: "empty-script.js",
   1012    matches: ["https://platform.twitter.com/widgets.js"],
   1013    logos: ["x-logo.svg"],
   1014    needsShimHelpers: [
   1015      "embedClicked",
   1016      "smartblockEmbedReplaced",
   1017      "smartblockGetFluentString",
   1018    ],
   1019    isSmartblockEmbedShim: true,
   1020    onlyIfBlockedByETP: true,
   1021    unblocksOnOptIn: [
   1022      "*://platform.twitter.com/*",
   1023      "*://syndication.twitter.com/*",
   1024      "*://cdn.syndication.twimg.com/*",
   1025      "*://video.twimg.com/*",
   1026      "*://pbs.twimg.com/*",
   1027      "*://abs.twimg.com/*",
   1028      "*://abs-0.twimg.com/*",
   1029    ],
   1030  },
   1031  {
   1032    id: "AliExpressInternationalization",
   1033    name: "AliExpress Internationalization",
   1034    bug: "1912228",
   1035    contentScripts: [
   1036      {
   1037        js: "aliexpress-language.js",
   1038        matches: ["*://*.aliexpress.us/*"],
   1039        runAt: "document_start",
   1040      },
   1041    ],
   1042    onlyIfDFPIActive: true,
   1043  },
   1044 ];
   1045 
   1046 if (typeof module !== "undefined") {
   1047  module.exports = AVAILABLE_SHIMS;
   1048 }