PageSourceSearch

https://www.mozilla.org/media/js/fxa_form.53cff8ed0641.js

js mozilla.org collected 2026-09-30 17:36:02 UTC 4,617 bytes, 1 lines download raw bytes

1!function(){"use strict";var e,t,n,i,o,a,r,u,m={},l=["utm_source","utm_campaign","utm_content","utm_term","utm_medium"].concat(["device_id","flow_id","flow_begin_time","entrypoint_experiment","entrypoint_variation"]);m.skipAttribution=!0,m.createInput=function(e,t){var n=document.createElement("input");return n.type="hidden",n.name=e,n.value=t,n},m.getAttributionData=function(e){for(var t=/^[\w/.%-]+$/,n={},i=0;i<l.length;i++){var o=l[i];if(Object.prototype.hasOwnProperty.call(e,o))try{var a=decodeURIComponent(e[o]);t.test(a)&&(n[o]=a)}catch(r){}}return Object.prototype.hasOwnProperty.call(n,"utm_source")&&Object.prototype.hasOwnProperty.call(n,"utm_campaign")||Object.prototype.hasOwnProperty.call(n,"entrypoint_experiment")&&Object.prototype.hasOwnProperty.call(n,"entrypoint_variation")?n:null},m.getUTMParams=function(){var e=(new window._SearchParams).utmParams();return m.getAttributionData(e)||{}},m.fetchTokens=function(){var m=e.getAttribute("action")+"metrics-flow";return m+="?form_type=email",m+="&entrypoint="+t.value,m+="&utm_source="+r.value,a&&(m+="&utm_content="+a.value),o&&(m+="&utm_campaign="+o.value),u&&(m+="&utm_term="+u.value),n&&(m+="&entrypoint_experiment="+n.value),i&&(m+="&entrypoint_variation="+i.value),fetch(m).then(function(e){return e.json()}).then(function(t){e.querySelector('[name="device_id"]').value=t.deviceId,e.querySelector('[name="flow_id"]').value=t.flowId,e.querySelector('[name="flow_begin_time"]').value=t.flowBeginTime})["catch"](function(){})},m.getExtraURLParams=function(){var e=document.getElementById("fxa-email-form-utm-source"),t=document.getElementById("fxa-email-form-utm-campaign"),n=document.getElementById("fxa-email-form-entrypoint-experiment"),i=document.getElementById("fxa-email-form-entrypoint-variation");if(m.skipAttribution)return e.value&&t.value?{utm_source:e.value,utm_campaign:t.value}:null;var o=m.getUTMParams();n&&n.value&&(o.entrypoint_experiment=n.value),i&&i.value&&(o.entrypoint_variation=i.value);var a=document.getElementById("fxa-email-form");if(a){var r=a.querySelector('[name="device_id"]'),u=a.querySelector('[name="flow_id"]'),l=a.querySelector('[name="flow_begin_time"]');r&&r.value&&(o.device_id=r.value),u&&u.value&&(o.flow_id=u.value),l&&l.value&&(o.flow_begin_time=parseInt(l.value,10))}return o},m.interceptFxANavigation=function(e){e.preventDefault();var t=m.getExtraURLParams(),n=document.getElementById("fxa-email-form-entrypoint"),i=document.getElementById("fxa-email-field"),o=null;return n&&n.value&&(o=n.value),i&&(i=i.value),Mozilla.UITour.showFirefoxAccounts(t,o,i)},m.setServiceContext=function(){var e=document.getElementById("fxa-email-form");if(e){var t=e.querySelector('[name="context"]');if(parseFloat(Mozilla.Client._getFirefoxVersion())>=80&&"undefined"!=typeof Mozilla.UITour){if(!t){var n=m.createInput("context","fx_desktop_v3");e.appendChild(n)}Mozilla.UITour.ping(function(){e.addEventListener("submit",m.interceptFxANavigation)})}}},m.configureSync=function(){Mozilla.Client._isFirefoxDesktop()&&m.setServiceContext()},m.isSupported=function(){return"Promise"in window&&"fetch"in window},m.init=function(l){return!!m.isSupported()&&(m.skipAttribution="boolean"!=typeof l||l,e=document.getElementById("fxa-email-form"),t=document.getElementById("fxa-email-form-entrypoint"),n=document.getElementById("fxa-email-form-entrypoint-experiment"),i=document.getElementById("fxa-email-form-entrypoint-variation"),o=document.getElementById("fxa-email-form-utm-campaign"),a=document.getElementById("fxa-email-form-utm-content"),r=document.getElementById("fxa-email-form-utm-source"),u=document.getElementById("fxa-email-form-utm-term"),new window.Promise(function(t,n){if(e)if(m.skipAttribution)t();else{var i=m.getUTMParams();
1Object.keys(i).forEach(function(t){if(e.querySelector('[name="'+t+'"]'))e.querySelector('[name="'+t+'"]').value=i[t];else{var n=m.createInput(t,i[t]);e.appendChild(n)}}),m.fetchTokens().then(function(){t()})}else n()}))};var c=m;var f="moz-consent-pref";var d={initForm:function(e){var t=!e;c.isSupported()&&c.init(t)["catch"](function(){})},handleConsent:function(e){d.initForm(e.detail.analytics),window.removeEventListener("mozConsentStatus",d.handleConsent,!1)},initEssential:function(){c.configureSync()},init:function(){if(d.initEssential(),(t=document.getElementsByTagName("html")[0].getAttribute("data-needs-consent"))&&"true"===t.toLowerCase())window.addEventListener("mozConsentStatus",d.handleConsent,!1);else{var e=function(){try{return JSON.parse(window.Mozilla.Cookies.getItem(f))}catch(e){return!1}}();e?d.initForm(e.analytics):d.initForm(!0)}var t}};d.init()}();

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