everest.js (4524B)
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 /** 8 * Bug 1728114 - Shim Adobe EverestJS 9 * 10 * Sites assuming EverestJS will load can break if it is blocked. 11 * This shim mitigates that breakage. 12 */ 13 14 if (!window.__ql) { 15 window.__ql = {}; 16 } 17 18 if (!window.EF) { 19 const AdCloudLocalStorage = { 20 get: (_, cb) => cb(), 21 isInitDone: true, 22 isInitSuccess: true, 23 }; 24 25 const emptyObj = {}; 26 27 const nullSrc = { 28 getHosts: () => [undefined], 29 getProtocols: () => [undefined], 30 hash: {}, 31 hashParamsOrder: [], 32 host: undefined, 33 path: [], 34 port: undefined, 35 query: {}, 36 queryDelimiter: "&", 37 queryParamsOrder: [], 38 queryPrefix: "?", 39 queryWithoutEncode: {}, 40 respectEmptyQueryParamValue: undefined, 41 scheme: undefined, 42 text: "//", 43 userInfo: undefined, 44 }; 45 46 const pixelDetailsEvent = { 47 addToDom() {}, 48 canAddToDom: () => false, 49 fire() {}, 50 getDomElement() {}, 51 initializeUri() {}, 52 pixelDetailsReceiver() {}, 53 scheme: "https:", 54 uri: nullSrc, 55 userid: 0, 56 }; 57 58 window.EF = { 59 AdCloudLocalStorage, 60 accessTopUrl: 0, 61 acquireCookieMatchingSlot() {}, 62 addListener() {}, 63 addPixelDetailsReadyListener() {}, 64 addToDom() {}, 65 allow3rdPartyPixels: 1, 66 appData: "", 67 appendDictionary() {}, 68 checkGlobalSid() {}, 69 checkUrlParams() {}, 70 cmHost: "cm.everesttech.net", 71 context: { 72 isFbApp: () => 0, 73 isPageview: () => false, 74 isSegmentation: () => false, 75 isTransaction: () => false, 76 }, 77 conversionData: "", 78 cookieMatchingSlots: 1, 79 debug: 0, 80 deserializeUrlParams: () => emptyObj, 81 doCookieMatching() {}, 82 ef_itp_ls: false, 83 eventType: "", 84 executeAfterLoad() {}, 85 executeOnloadCallbacks() {}, 86 expectedTrackingParams: ["ev_cl", "ev_sid"], 87 fbIsApp: 0, 88 fbsCM: 0, 89 fbsPixelId: 0, 90 filterList: () => [], 91 getArrayIndex: -1, 92 getConversionData: () => "", 93 getConversionDataFromLocalStorage: cb => cb(), 94 getDisplayClickUri: () => "", 95 getEpochFromEfUniq: () => 0, 96 getFirstLevelObjectCopy: () => emptyObj, 97 getInvisibleIframeElement() {}, 98 getInvisibleImageElement() {}, 99 getMacroSubstitutedText: () => "", 100 getPixelDetails: cb => cb({}), 101 getScriptElement() {}, 102 getScriptSrc: () => "", 103 getServerParams: () => emptyObj, 104 getSortedAttributes: () => [], 105 getTrackingParams: () => emptyObj, 106 getTransactionParams: () => emptyObj, 107 handleConversionData() {}, 108 impressionProperties: "", 109 impressionTypes: ["impression", "impression_served"], 110 inFloodlight: 0, 111 init(config) { 112 try { 113 const { userId } = config; 114 window.EF.userId = userId; 115 pixelDetailsEvent.userId = userId; 116 } catch (_) {} 117 }, 118 initializeEFVariables() {}, 119 isArray: a => Array.isArray(a), 120 isEmptyDictionary: () => true, 121 isITPEnabled: () => false, 122 isPermanentCookieSet: () => false, 123 isSearchClick: () => 0, 124 isXSSReady() {}, 125 jsHost: "www.everestjs.net", 126 jsTagAdded: 0, 127 location: nullSrc, 128 locationHref: nullSrc, 129 locationSkipBang: nullSrc, 130 log() {}, 131 main() {}, 132 main2() {}, 133 newCookieMatchingEvent: () => emptyObj, 134 newFbsCookieMatching: () => emptyObj, 135 newImpression: () => emptyObj, 136 newPageview: () => emptyObj, 137 newPixelDetails: () => emptyObj, 138 newPixelEvent: () => emptyObj, 139 newPixelServerDisplayClickRedirectUri: () => emptyObj, 140 newPixelServerGenericRedirectUri: () => emptyObj, 141 newPixelServerUri: () => emptyObj, 142 newProductSegment: () => emptyObj, 143 newSegmentJavascript: () => emptyObj, 144 newTransaction: () => emptyObj, 145 newUri: () => emptyObj, 146 onloadCallbacks: [], 147 pageViewProperties: "", 148 pageviewProperties: "", 149 pixelDetails: {}, 150 pixelDetailsAdded: 1, 151 pixelDetailsEvent, 152 pixelDetailsParams: [], 153 pixelDetailsReadyCallbackFns: [], 154 pixelDetailsRecieverCalled: 1, 155 pixelHost: "pixel.everesttech.net", 156 protocol: document?.location?.protocol || "", 157 referrer: nullSrc, 158 removeListener() {}, 159 searchSegment: "", 160 segment: "", 161 serverParamsListener() {}, 162 sid: 0, 163 sku: "", 164 throttleCookie: "", 165 trackingJavascriptSrc: nullSrc, 166 transactionObjectList: [], 167 transactionProperties: "", 168 userServerParams: {}, 169 userid: 0, 170 }; 171 }