From aab92f452f640dab32af381d5fe10e6d39d4c120 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Sat, 22 Jan 2022 17:31:28 +0100 Subject: [PATCH] url fix --- bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle.js b/bundle.js index d5b8422..485efd4 100644 --- a/bundle.js +++ b/bundle.js @@ -5,4 +5,4 @@ `,o],u.Error);return}a.config.logPings&&l(Mt,JSON.stringify(n,null,2),u.Info);let s=i||n,c=Ei();return a.pingsDatabase.recordPing(Si(e,t),e,s,c)}var an=_i;var Dt="core.Pings.PingType",gt=class{constructor(t){var r;this.name=t.name,this.includeClientId=t.includeClientId,this.sendIfEmpty=t.sendIfEmpty,this.reasonCodes=(r=t.reasonCodes)!==null&&r!==void 0?r:[]}isDeletionRequest(){return this.name===Tt}submit(t){this.testCallback?this.testCallback(t).then(()=>{gt._private_internalSubmit(this,t,this.resolveTestPromiseFunction)}).catch(r=>{l(Dt,[`There was an error validating "${this.name}" (${t??"no reason"}):`,r],u.Error),gt._private_internalSubmit(this,t,this.rejectTestPromiseFunction)}):gt._private_internalSubmit(this,t)}static async _private_submitUndispatched(t,r,n){if(!a.initialized){l(Dt,"Glean must be initialized before submitting pings.",u.Info);return}if(!a.uploadEnabled&&!t.isDeletionRequest()){l(Dt,"Glean disabled: not submitting pings. Glean may still submit the deletion-request ping.",u.Info);return}let i=r;r&&!t.reasonCodes.includes(r)&&(l(Dt,`Invalid reason code ${r} from ${this.name}. Ignoring.`,u.Warn),i=void 0);let s=ht();await an(s,t,i),n&&(n(),t.resolveTestPromiseFunction=void 0,t.rejectTestPromiseFunction=void 0,t.testCallback=void 0)}static _private_internalSubmit(t,r,n){a.dispatcher.launch(async()=>{await gt._private_submitUndispatched(t,r,n)})}async testBeforeNextSubmit(t){if(_("testBeforeNextSubmit",Dt)){if(this.testCallback){l(Dt,`There is an existing test call for ping "${this.name}". Ignoring.`,u.Error);return}return new Promise((r,n)=>{this.resolveTestPromiseFunction=r,this.rejectTestPromiseFunction=n,this.testCallback=t})}}},Pt=gt;var sn=class{constructor(){this.deletionRequest=new Pt({name:Tt,includeClientId:!0,sendIfEmpty:!0})}},on=sn;var Mi="core.Events.Utils";function cn(e){let t=e.event;if(t in ut){ut[t].registerPlugin(e);return}l(Mi,[`Attempted to register plugin '${e.name}', which listens to the event '${e.event}'.`,"That is not a valid Glean event. Ignoring"],u.Error)}function ln(){for(let e in ut)ut[e].deregisterPlugin()}function Di(e){return`core.Metrics.${e.type.charAt(0).toUpperCase()+e.type.slice(1)}`}function un(e,t){let r=e.baseIdentifier(),n=yr(r);return new Z({name:Yt(t,n),category:"glean.error",lifetime:"ping",sendInPings:e.sendInPings,disabled:!1})}var fe=class{async record(t,r,n,i=1){let s=un(t,r);l(Di(t),[`${t.baseIdentifier()}:`,n]),i>0&&await Z._private_addUndispatched(s,i)}async testGetNumRecordedErrors(t,r,n){return await un(t,r).testGetValue(n)||0}};var Pi="plaftom.test.Storage",Bt={},fn=class{constructor(t){this.rootKey=t}get(t=[]){try{let r=Kt(Bt,[this.rootKey,...t]);return Promise.resolve(r)}catch(r){return Promise.reject(r)}}update(t,r){try{return Bt=Ht(Bt,[this.rootKey,...t],r),Promise.resolve()}catch(n){return Promise.reject(n)}}delete(t){try{Bt=Zt(Bt,[this.rootKey,...t])}catch(r){l(Pi,[`Error attempting to delete key ${t.toString()} from storage. Ignoring.`,r],u.Warn)}return Promise.resolve()}},hn=fn;var pn=class extends qt{post(t,r,n){let i=new ot(2,200);return Promise.resolve(i)}},Ai={os(){return Promise.resolve("Unknown")},osVersion(){return Promise.resolve("Unknown")},arch(){return Promise.resolve("Unknown")},locale(){return Promise.resolve("Unknown")}},Ui=typeof setTimeout!="undefined"?setTimeout:()=>{throw new Error},Oi=typeof clearTimeout!="undefined"?clearTimeout:()=>{},Li={Storage:hn,uploader:new pn,info:Ai,timer:{setTimeout:Ui,clearTimeout:Oi},name:"test"},dn=Li;var nt="core.Glean",We;(function(e){e.coreMetrics=new je,e.corePings=new on;async function t(){a.uploadEnabled=!0,await e.coreMetrics.initialize()}async function r(){a.uploadEnabled=!1,await Pt._private_submitUndispatched(e.corePings.deletionRequest),await n()}async function n(){await e.pingUploader.clearPendingPingsQueue();let d;try{d=new $(await a.metricsDatabase.getMetric(lt,e.coreMetrics.firstRunDate)).date}catch{d=new Date}await a.eventsDatabase.clearAll(),await a.metricsDatabase.clearAll(),await a.pingsDatabase.clearAll(),a.uploadEnabled=!0,await zt._private_setUndispatched(e.coreMetrics.clientId,Gt),await Y._private_setUndispatched(e.coreMetrics.firstRunDate,d),a.uploadEnabled=!1}function i(d,y,I){if(a.initialized){l(nt,"Attempted to initialize Glean, but it has already been initialized. Ignoring.",u.Warn);return}if(!E(d)){l(nt,"Unable to initialize Glean, applicationId must be a string.",u.Error);return}if(!bt(y)){l(nt,"Unable to initialize Glean, uploadEnabled must be a boolean.",u.Error);return}if(d.length===0){l(nt,"Unable to initialize Glean, applicationId cannot be an empty string.",u.Error);return}if(!a.platform){l(nt,"Unable to initialize Glean, platform has not been set.",u.Error);return}a.applicationId=ur(d);let L=new Ee(I);if(a.config=L,a.metricsDatabase=new Mr,a.eventsDatabase=new rn,a.pingsDatabase=new kr,a.errorManager=new fe,e.pingUploader=new Hr(L,a.pingsDatabase),I==null?void 0:I.plugins)for(let D of I.plugins)cn(D);a.dispatcher.flushInit(async()=>{if(a.initialized=!0,a.uploadEnabled=y,y)await a.metricsDatabase.clear("application"),await t();else{let D=await a.metricsDatabase.getMetric(lt,e.coreMetrics.clientId);D?D!==Gt&&await r():await n()}await a.eventsDatabase.initialize(),await a.pingsDatabase.scanPendingPings()})}e.initialize=i;function s(d){if(!a.initialized){l(nt,[`Changing upload enabled before Glean is initialized is not supported. `,"Pass the correct state into `initialize`.\n","See documentation at https://mozilla.github.io/glean/book/user/general-api.html#initializing-the-glean-sdk`"],u.Error);return}if(!bt(d)){l(nt,"Unable to change upload state, new value must be a boolean. Ignoring.",u.Error);return}a.dispatcher.launch(async()=>{a.uploadEnabled!==d&&(d?await t():await r())})}e.setUploadEnabled=s;function c(d){a.dispatcher.launch(()=>(a.config.logPings=d,Promise.resolve()))}e.setLogPings=c;function o(d){a.dispatcher.launch(()=>(a.config.debugViewTag=d,Promise.resolve()))}e.setDebugViewTag=o;function p(d){a.dispatcher.launch(()=>(a.config.sourceTags=d,Promise.resolve()))}e.setSourceTags=p;async function h(){if(!a.initialized){l(nt,"Attempted to shutdown Glean, but Glean is not initialized. Ignoring.");return}await a.dispatcher.shutdown(),await e.pingUploader.blockOnOngoingUploads()}e.shutdown=h;function f(d){a.initialized||(a.isPlatformSet()&&a.platform.name!==d.name&&!a.testing&&l(nt,[`IMPOSSIBLE: Attempted to change Glean's targeted platform", - "from "${a.platform.name}" to "${d.name}". Ignoring.`],u.Error),a.platform=d)}e.setPlatform=f;async function g(d,y=!0,I){a.testing=!0,f(dn),i(d,y,I),await a.dispatcher.testBlockOnQueue()}e.testInitialize=g;async function m(d=!0){a.initialized&&(await h(),d&&(await a.eventsDatabase.clearAll(),await a.metricsDatabase.clearAll(),await a.pingsDatabase.clearAll()),a.testUninitialize(),ln())}e.testUninitialize=m;async function b(d,y=!0,I,L=!0){await m(L),await g(d,y,I)}e.testResetGlean=b})(We||(We={}));var it=We;var mn=e=>({initialize(t,r,n){it.setPlatform(e),it.initialize(t,r,n)},setUploadEnabled(t){it.setUploadEnabled(t)},setLogPings(t){it.setLogPings(t)},setDebugViewTag(t){it.setDebugViewTag(t)},shutdown(){return it.shutdown()},setSourceTags(t){it.setSourceTags(t)},async testResetGlean(t,r=!0,n){return it.testResetGlean(t,r,n)}});var gn=mn(dr);var vn=new Pt({includeClientId:!0,sendIfEmpty:!1,name:"visit",reasonCodes:[]});var wn=new Y({category:"page",name:"loaded",sendInPings:["visit"],lifetime:"ping",disabled:!1},"millisecond"),yn=new O({category:"page",name:"path",sendInPings:["visit"],lifetime:"ping",disabled:!1});function Gi(e){document.readyState!="loading"?e():document.addEventListener("DOMContentLoaded",e)}Gi(()=>{let e={serverEndpoint:"https://telemetry-ingestion.fly.dev/"};gn.initialize("net-rediger-jer",!0,e),wn.set(),yn.set(location.pathname),vn.submit()});})(); + "from "${a.platform.name}" to "${d.name}". Ignoring.`],u.Error),a.platform=d)}e.setPlatform=f;async function g(d,y=!0,I){a.testing=!0,f(dn),i(d,y,I),await a.dispatcher.testBlockOnQueue()}e.testInitialize=g;async function m(d=!0){a.initialized&&(await h(),d&&(await a.eventsDatabase.clearAll(),await a.metricsDatabase.clearAll(),await a.pingsDatabase.clearAll()),a.testUninitialize(),ln())}e.testUninitialize=m;async function b(d,y=!0,I,L=!0){await m(L),await g(d,y,I)}e.testResetGlean=b})(We||(We={}));var it=We;var mn=e=>({initialize(t,r,n){it.setPlatform(e),it.initialize(t,r,n)},setUploadEnabled(t){it.setUploadEnabled(t)},setLogPings(t){it.setLogPings(t)},setDebugViewTag(t){it.setDebugViewTag(t)},shutdown(){return it.shutdown()},setSourceTags(t){it.setSourceTags(t)},async testResetGlean(t,r=!0,n){return it.testResetGlean(t,r,n)}});var gn=mn(dr);var vn=new Pt({includeClientId:!0,sendIfEmpty:!1,name:"visit",reasonCodes:[]});var wn=new Y({category:"page",name:"loaded",sendInPings:["visit"],lifetime:"ping",disabled:!1},"millisecond"),yn=new O({category:"page",name:"path",sendInPings:["visit"],lifetime:"ping",disabled:!1});function Gi(e){document.readyState!="loading"?e():document.addEventListener("DOMContentLoaded",e)}Gi(()=>{let e={serverEndpoint:"https://telemetry-ingestion.fly.dev"};gn.initialize("net-rediger-jer",!0,e),wn.set(),yn.set(location.pathname),vn.submit()});})();