@cloudcare/browser-core 3.2.22 → 3.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/browser/addEventListener.js +4 -2
- package/cjs/browser/addEventListener.js.map +1 -1
- package/cjs/browser/asyncClocks.js +68 -0
- package/cjs/browser/asyncClocks.js.map +1 -0
- package/cjs/dataMap.js +1 -0
- package/cjs/dataMap.js.map +1 -1
- package/cjs/helper/deviceInfo.js +6 -1
- package/cjs/helper/deviceInfo.js.map +1 -1
- package/cjs/helper/getZoneJsOriginalValue.js +2 -1
- package/cjs/helper/getZoneJsOriginalValue.js.map +1 -1
- package/cjs/helper/valueHistory.js +19 -6
- package/cjs/helper/valueHistory.js.map +1 -1
- package/cjs/session/sessionStoreOperations.js +4 -4
- package/cjs/session/sessionStoreOperations.js.map +1 -1
- package/cjs/tracekit/computeStackTrace.js +1 -1
- package/cjs/tracekit/computeStackTrace.js.map +1 -1
- package/cjs/transport/eventBridge.js +8 -1
- package/cjs/transport/eventBridge.js.map +1 -1
- package/esm/browser/addEventListener.js +4 -2
- package/esm/browser/addEventListener.js.map +1 -1
- package/esm/browser/asyncClocks.js +60 -0
- package/esm/browser/asyncClocks.js.map +1 -0
- package/esm/dataMap.js +1 -0
- package/esm/dataMap.js.map +1 -1
- package/esm/helper/deviceInfo.js +6 -1
- package/esm/helper/deviceInfo.js.map +1 -1
- package/esm/helper/getZoneJsOriginalValue.js +2 -1
- package/esm/helper/getZoneJsOriginalValue.js.map +1 -1
- package/esm/helper/valueHistory.js +19 -6
- package/esm/helper/valueHistory.js.map +1 -1
- package/esm/session/sessionStoreOperations.js +4 -4
- package/esm/session/sessionStoreOperations.js.map +1 -1
- package/esm/tracekit/computeStackTrace.js +1 -1
- package/esm/tracekit/computeStackTrace.js.map +1 -1
- package/esm/transport/eventBridge.js +8 -1
- package/esm/transport/eventBridge.js.map +1 -1
- package/package.json +2 -2
- package/src/browser/addEventListener.js +7 -2
- package/src/browser/asyncClocks.js +69 -0
- package/src/dataMap.js +1 -0
- package/src/helper/deviceInfo.js +6 -1
- package/src/helper/getZoneJsOriginalValue.js +2 -1
- package/src/helper/valueHistory.js +18 -6
- package/src/session/sessionStoreOperations.js +4 -16
- package/src/tracekit/computeStackTrace.js +2 -1
- package/src/transport/eventBridge.js +20 -2
|
@@ -48,7 +48,7 @@ function processSessionStoreOperations(operations, sessionStoreStrategy) {
|
|
|
48
48
|
var currentStore = retrieveStore();
|
|
49
49
|
if (isLockEnabled) {
|
|
50
50
|
// if someone has lock, retry later
|
|
51
|
-
if (currentStore.lock
|
|
51
|
+
if (currentStore.lock) {
|
|
52
52
|
retryLater(operations, sessionStoreStrategy, numberOfRetries);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function processSessionStoreOperations(operations, sessionStoreStrategy) {
|
|
|
57
57
|
persistWithLock(currentStore.session);
|
|
58
58
|
// if lock is not acquired, retry later
|
|
59
59
|
currentStore = retrieveStore();
|
|
60
|
-
if (currentStore.lock !== currentLock
|
|
60
|
+
if (currentStore.lock !== currentLock) {
|
|
61
61
|
retryLater(operations, sessionStoreStrategy, numberOfRetries);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -66,7 +66,7 @@ function processSessionStoreOperations(operations, sessionStoreStrategy) {
|
|
|
66
66
|
if (isLockEnabled) {
|
|
67
67
|
// if lock corrupted after process, retry later
|
|
68
68
|
currentStore = retrieveStore();
|
|
69
|
-
if (currentStore.lock !== currentLock
|
|
69
|
+
if (currentStore.lock !== currentLock) {
|
|
70
70
|
retryLater(operations, sessionStoreStrategy, numberOfRetries);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
@@ -85,7 +85,7 @@ function processSessionStoreOperations(operations, sessionStoreStrategy) {
|
|
|
85
85
|
if (!(processedSession && (0, _sessionState.isSessionInExpiredState)(processedSession))) {
|
|
86
86
|
// if lock corrupted after persist, retry later
|
|
87
87
|
currentStore = retrieveStore();
|
|
88
|
-
if (currentStore.lock !== currentLock
|
|
88
|
+
if (currentStore.lock !== currentLock) {
|
|
89
89
|
retryLater(operations, sessionStoreStrategy, numberOfRetries);
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStoreOperations.js","names":["_timer","require","_tools","_sessionState","LOCK_RETRY_DELAY","exports","LOCK_MAX_TRIES","bufferedOperations","ongoingOperations","processSessionStoreOperations","operations","sessionStoreStrategy","numberOfRetries","arguments","length","undefined","isLockEnabled","persistSession","expireSession","persistWithLock","session","assign","lock","currentLock","retrieveStore","retrieveSession","push","next","currentStore","
|
|
1
|
+
{"version":3,"file":"sessionStoreOperations.js","names":["_timer","require","_tools","_sessionState","LOCK_RETRY_DELAY","exports","LOCK_MAX_TRIES","bufferedOperations","ongoingOperations","processSessionStoreOperations","operations","sessionStoreStrategy","numberOfRetries","arguments","length","undefined","isLockEnabled","persistSession","expireSession","persistWithLock","session","assign","lock","currentLock","retrieveStore","retrieveSession","push","next","currentStore","retryLater","UUID","processedSession","process","isSessionInExpiredState","expandSessionState","after","sessionStore","currentNumberOfRetries","setTimeout","nextOperations","shift"],"sources":["../../src/session/sessionStoreOperations.js"],"sourcesContent":["import { setTimeout } from '../helper/timer'\nimport { UUID, assign } from '../helper/tools'\nimport {\n expandSessionState,\n isSessionInExpiredState,\n isSessionInNotStartedState\n} from './sessionState'\n\nexport const LOCK_RETRY_DELAY = 10\nexport const LOCK_MAX_TRIES = 100\nconst bufferedOperations = []\nlet ongoingOperations\n\nexport function processSessionStoreOperations(\n operations,\n sessionStoreStrategy,\n numberOfRetries = 0\n) {\n const { isLockEnabled, persistSession, expireSession } = sessionStoreStrategy\n const persistWithLock = function (session) {\n return persistSession(assign({}, session, { lock: currentLock }))\n }\n const retrieveStore = function () {\n const session = sessionStoreStrategy.retrieveSession()\n const lock = session.lock\n if (session.lock) {\n delete session.lock\n }\n\n return {\n session,\n lock\n }\n }\n\n if (!ongoingOperations) {\n ongoingOperations = operations\n }\n if (operations !== ongoingOperations) {\n bufferedOperations.push(operations)\n return\n }\n if (isLockEnabled && numberOfRetries >= LOCK_MAX_TRIES) {\n next(sessionStoreStrategy)\n return\n }\n let currentLock\n let currentStore = retrieveStore()\n if (isLockEnabled) {\n // if someone has lock, retry later\n if (currentStore.lock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries)\n return\n }\n // acquire lock\n currentLock = UUID()\n persistWithLock(currentStore.session)\n // if lock is not acquired, retry later\n currentStore = retrieveStore()\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries)\n return\n }\n }\n let processedSession = operations.process(currentStore.session)\n if (isLockEnabled) {\n // if lock corrupted after process, retry later\n currentStore = retrieveStore()\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries)\n return\n }\n }\n if (processedSession) {\n if (isSessionInExpiredState(processedSession)) {\n expireSession()\n } else {\n expandSessionState(processedSession)\n isLockEnabled\n ? persistWithLock(processedSession)\n : persistSession(processedSession)\n }\n }\n if (isLockEnabled) {\n // correctly handle lock around expiration would require to handle this case properly at several levels\n // since we don't have evidence of lock issues around expiration, let's just not do the corruption check for it\n if (!(processedSession && isSessionInExpiredState(processedSession))) {\n // if lock corrupted after persist, retry later\n currentStore = retrieveStore()\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries)\n return\n }\n persistSession(currentStore.session)\n processedSession = currentStore.session\n }\n }\n // call after even if session is not persisted in order to perform operations on\n // up-to-date session state value => the value could have been modified by another tab\n if (operations.after) {\n operations.after(processedSession || currentStore.session)\n }\n next(sessionStoreStrategy)\n}\n\nfunction retryLater(operations, sessionStore, currentNumberOfRetries) {\n setTimeout(function () {\n processSessionStoreOperations(\n operations,\n sessionStore,\n currentNumberOfRetries + 1\n )\n }, LOCK_RETRY_DELAY)\n}\n\nfunction next(sessionStore) {\n ongoingOperations = undefined\n const nextOperations = bufferedOperations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gBAAgB,IAAI,IAAAE,qCAAuB,EAACF,gBAAgB,CAAC,CAAC,EAAE;MACpE;MACAH,YAAY,GAAGJ,aAAa,CAAC,CAAC;MAC9B,IAAII,YAAY,CAACN,IAAI,KAAKC,WAAW,EAAE;QACrCM,UAAU,CAACnB,UAAU,EAAEC,oBAAoB,EAAEC,eAAe,CAAC;QAC7D;MACF;MACAK,cAAc,CAACW,YAAY,CAACR,OAAO,CAAC;MACpCW,gBAAgB,GAAGH,YAAY,CAACR,OAAO;IACzC;EACF;EACA;EACA;EACA,IAAIV,UAAU,CAACyB,KAAK,EAAE;IACpBzB,UAAU,CAACyB,KAAK,CAACJ,gBAAgB,IAAIH,YAAY,CAACR,OAAO,CAAC;EAC5D;EACAO,IAAI,CAAChB,oBAAoB,CAAC;AAC5B;AAEA,SAASkB,UAAUA,CAACnB,UAAU,EAAE0B,YAAY,EAAEC,sBAAsB,EAAE;EACpE,IAAAC,iBAAU,EAAC,YAAY;IACrB7B,6BAA6B,CAC3BC,UAAU,EACV0B,YAAY,EACZC,sBAAsB,GAAG,CAC3B,CAAC;EACH,CAAC,EAAEjC,gBAAgB,CAAC;AACtB;AAEA,SAASuB,IAAIA,CAACS,YAAY,EAAE;EAC1B5B,iBAAiB,GAAGO,SAAS;EAC7B,IAAMwB,cAAc,GAAGhC,kBAAkB,CAACiC,KAAK,CAAC,CAAC;EACjD,IAAID,cAAc,EAAE;IAClB9B,6BAA6B,CAAC8B,cAAc,EAAEH,YAAY,CAAC;EAC7D;AACF","ignoreList":[]}
|
|
@@ -89,7 +89,7 @@ function parseWinLine(line) {
|
|
|
89
89
|
url: parts[2]
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
var GECKO_LINE_RE = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
92
|
+
var GECKO_LINE_RE = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
93
93
|
var GECKO_EVAL_RE = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
94
94
|
function parseGeckoLine(line) {
|
|
95
95
|
var parts = GECKO_LINE_RE.exec(line);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeStackTrace.js","names":["_tools","require","_typeof","o","Symbol","iterator","constructor","prototype","UNKNOWN_FUNCTION","computeStackTrace","ex","stack","stackProperty","tryToGetString","exString","String","startsWith","slice","length","each","split","line","stackFrame","parseChromeLine","parseChromeAnonymousLine","parseWinLine","parseGeckoLine","func","push","message","name","fileUrl","filePosition","CHROME_LINE_RE","RegExp","CHROME_EVAL_RE","parts","exec","isNative","indexOf","isEval","submatch","args","column","undefined","url","CHROME_ANONYMOUS_FUNCTION_RE","WINJS_LINE_RE","GECKO_LINE_RE","GECKO_EVAL_RE","candidate","property","value"],"sources":["../../src/tracekit/computeStackTrace.js"],"sourcesContent":["import { each } from '../helper/tools'\nvar UNKNOWN_FUNCTION = '?'\n\n/**\n * Computes a stack trace for an exception.\n */\nexport function computeStackTrace(ex) {\n var stack = []\n\n var stackProperty = tryToGetString(ex, 'stack')\n var exString = String(ex)\n if (stackProperty && stackProperty.startsWith(exString)) {\n stackProperty = stackProperty.slice(exString.length)\n }\n if (stackProperty) {\n each(stackProperty.split('\\n'), function (line) {\n var stackFrame =\n parseChromeLine(line) ||\n parseChromeAnonymousLine(line) ||\n parseWinLine(line) ||\n parseGeckoLine(line)\n if (stackFrame) {\n if (!stackFrame.func && stackFrame.line) {\n stackFrame.func = UNKNOWN_FUNCTION\n }\n stack.push(stackFrame)\n }\n })\n }\n\n return {\n message: tryToGetString(ex, 'message'),\n name: tryToGetString(ex, 'name'),\n stack: stack\n }\n}\nvar fileUrl =\n '((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|<anonymous>|\\\\w+\\\\.|\\\\/).*?)'\nvar filePosition = '(?::(\\\\d+))'\nvar CHROME_LINE_RE = new RegExp(\n '^\\\\s*at (.*?) ?\\\\(' +\n fileUrl +\n filePosition +\n '?' +\n filePosition +\n '?\\\\)?\\\\s*$',\n 'i'\n)\nvar CHROME_EVAL_RE = new RegExp(\n '\\\\((\\\\S*)' + filePosition + filePosition + '\\\\)'\n)\n\nfunction parseChromeLine(line) {\n var parts = CHROME_LINE_RE.exec(line)\n\n if (!parts) {\n return\n }\n\n var isNative = parts[2] && parts[2].indexOf('native') === 0 // start of line\n var isEval = parts[2] && parts[2].indexOf('eval') === 0 // start of line\n var submatch = CHROME_EVAL_RE.exec(parts[2])\n\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1] // url\n parts[3] = submatch[2] // line\n parts[4] = submatch[3] // column\n }\n\n return {\n args: isNative ? [parts[2]] : [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[3] ? +parts[3] : undefined,\n url: !isNative ? parts[2] : undefined\n }\n}\n\nvar CHROME_ANONYMOUS_FUNCTION_RE = new RegExp(\n '^\\\\s*at ?' + fileUrl + filePosition + '?' + filePosition + '??\\\\s*$',\n 'i'\n)\n\nfunction parseChromeAnonymousLine(line) {\n var parts = CHROME_ANONYMOUS_FUNCTION_RE.exec(line)\n\n if (!parts) {\n return\n }\n\n return {\n args: [],\n column: parts[3] ? +parts[3] : undefined,\n func: UNKNOWN_FUNCTION,\n line: parts[2] ? +parts[2] : undefined,\n url: parts[1]\n }\n}\n\nvar WINJS_LINE_RE =\n /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i\n\nfunction parseWinLine(line) {\n var parts = WINJS_LINE_RE.exec(line)\n if (!parts) {\n return\n }\n\n return {\n args: [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: +parts[3],\n url: parts[2]\n }\n}\n\nvar GECKO_LINE_RE =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i\nvar GECKO_EVAL_RE = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i\n\nfunction parseGeckoLine(line) {\n var parts = GECKO_LINE_RE.exec(line)\n if (!parts) {\n return\n }\n\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1\n var submatch = GECKO_EVAL_RE.exec(parts[3])\n\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1]\n parts[4] = submatch[2]\n parts[5] = undefined // no column when eval\n }\n\n return {\n args: parts[2] ? parts[2].split(',') : [],\n column: parts[5] ? +parts[5] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[4] ? +parts[4] : undefined,\n url: parts[3]\n }\n}\n\nfunction tryToGetString(candidate, property) {\n if (typeof candidate !== 'object' || !candidate || !(property in candidate)) {\n return undefined\n }\n var value = candidate[property]\n return typeof value === 'string' ? value : undefined\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAsC,SAAAC,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AACtC,IAAIK,gBAAgB,GAAG,GAAG;;AAE1B;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,EAAE,EAAE;EACpC,IAAIC,KAAK,GAAG,EAAE;EAEd,IAAIC,aAAa,GAAGC,cAAc,CAACH,EAAE,EAAE,OAAO,CAAC;EAC/C,IAAII,QAAQ,GAAGC,MAAM,CAACL,EAAE,CAAC;EACzB,IAAIE,aAAa,IAAIA,aAAa,CAACI,UAAU,CAACF,QAAQ,CAAC,EAAE;IACvDF,aAAa,GAAGA,aAAa,CAACK,KAAK,CAACH,QAAQ,CAACI,MAAM,CAAC;EACtD;EACA,IAAIN,aAAa,EAAE;IACjB,IAAAO,WAAI,EAACP,aAAa,CAACQ,KAAK,CAAC,IAAI,CAAC,EAAE,UAAUC,IAAI,EAAE;MAC9C,IAAIC,UAAU,GACZC,eAAe,CAACF,IAAI,CAAC,IACrBG,wBAAwB,CAACH,IAAI,CAAC,IAC9BI,YAAY,CAACJ,IAAI,CAAC,IAClBK,cAAc,CAACL,IAAI,CAAC;MACtB,IAAIC,UAAU,EAAE;QACd,IAAI,CAACA,UAAU,CAACK,IAAI,IAAIL,UAAU,CAACD,IAAI,EAAE;UACvCC,UAAU,CAACK,IAAI,GAAGnB,gBAAgB;QACpC;QACAG,KAAK,CAACiB,IAAI,CAACN,UAAU,CAAC;MACxB;IACF,CAAC,CAAC;EACJ;EAEA,OAAO;IACLO,OAAO,EAAEhB,cAAc,CAACH,EAAE,EAAE,SAAS,CAAC;IACtCoB,IAAI,EAAEjB,cAAc,CAACH,EAAE,EAAE,MAAM,CAAC;IAChCC,KAAK,EAAEA;EACT,CAAC;AACH;AACA,IAAIoB,OAAO,GACT,iGAAiG;
|
|
1
|
+
{"version":3,"file":"computeStackTrace.js","names":["_tools","require","_typeof","o","Symbol","iterator","constructor","prototype","UNKNOWN_FUNCTION","computeStackTrace","ex","stack","stackProperty","tryToGetString","exString","String","startsWith","slice","length","each","split","line","stackFrame","parseChromeLine","parseChromeAnonymousLine","parseWinLine","parseGeckoLine","func","push","message","name","fileUrl","filePosition","CHROME_LINE_RE","RegExp","CHROME_EVAL_RE","parts","exec","isNative","indexOf","isEval","submatch","args","column","undefined","url","CHROME_ANONYMOUS_FUNCTION_RE","WINJS_LINE_RE","GECKO_LINE_RE","GECKO_EVAL_RE","candidate","property","value"],"sources":["../../src/tracekit/computeStackTrace.js"],"sourcesContent":["import { each } from '../helper/tools'\nvar UNKNOWN_FUNCTION = '?'\n\n/**\n * Computes a stack trace for an exception.\n */\nexport function computeStackTrace(ex) {\n var stack = []\n\n var stackProperty = tryToGetString(ex, 'stack')\n var exString = String(ex)\n if (stackProperty && stackProperty.startsWith(exString)) {\n stackProperty = stackProperty.slice(exString.length)\n }\n if (stackProperty) {\n each(stackProperty.split('\\n'), function (line) {\n var stackFrame =\n parseChromeLine(line) ||\n parseChromeAnonymousLine(line) ||\n parseWinLine(line) ||\n parseGeckoLine(line)\n if (stackFrame) {\n if (!stackFrame.func && stackFrame.line) {\n stackFrame.func = UNKNOWN_FUNCTION\n }\n stack.push(stackFrame)\n }\n })\n }\n\n return {\n message: tryToGetString(ex, 'message'),\n name: tryToGetString(ex, 'name'),\n stack: stack\n }\n}\nvar fileUrl =\n '((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|<anonymous>|\\\\w+\\\\.|\\\\/).*?)'\n\nvar filePosition = '(?::(\\\\d+))'\nvar CHROME_LINE_RE = new RegExp(\n '^\\\\s*at (.*?) ?\\\\(' +\n fileUrl +\n filePosition +\n '?' +\n filePosition +\n '?\\\\)?\\\\s*$',\n 'i'\n)\nvar CHROME_EVAL_RE = new RegExp(\n '\\\\((\\\\S*)' + filePosition + filePosition + '\\\\)'\n)\n\nfunction parseChromeLine(line) {\n var parts = CHROME_LINE_RE.exec(line)\n\n if (!parts) {\n return\n }\n\n var isNative = parts[2] && parts[2].indexOf('native') === 0 // start of line\n var isEval = parts[2] && parts[2].indexOf('eval') === 0 // start of line\n var submatch = CHROME_EVAL_RE.exec(parts[2])\n\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1] // url\n parts[3] = submatch[2] // line\n parts[4] = submatch[3] // column\n }\n\n return {\n args: isNative ? [parts[2]] : [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[3] ? +parts[3] : undefined,\n url: !isNative ? parts[2] : undefined\n }\n}\n\nvar CHROME_ANONYMOUS_FUNCTION_RE = new RegExp(\n '^\\\\s*at ?' + fileUrl + filePosition + '?' + filePosition + '??\\\\s*$',\n 'i'\n)\n\nfunction parseChromeAnonymousLine(line) {\n var parts = CHROME_ANONYMOUS_FUNCTION_RE.exec(line)\n\n if (!parts) {\n return\n }\n\n return {\n args: [],\n column: parts[3] ? +parts[3] : undefined,\n func: UNKNOWN_FUNCTION,\n line: parts[2] ? +parts[2] : undefined,\n url: parts[1]\n }\n}\n\nvar WINJS_LINE_RE =\n /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i\n\nfunction parseWinLine(line) {\n var parts = WINJS_LINE_RE.exec(line)\n if (!parts) {\n return\n }\n\n return {\n args: [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: +parts[3],\n url: parts[2]\n }\n}\n\nvar GECKO_LINE_RE =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\\[native).*?|[^@]*bundle|\\[wasm code\\])(?::(\\d+))?(?::(\\d+))?\\s*$/i\nvar GECKO_EVAL_RE = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i\n\nfunction parseGeckoLine(line) {\n var parts = GECKO_LINE_RE.exec(line)\n if (!parts) {\n return\n }\n\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1\n var submatch = GECKO_EVAL_RE.exec(parts[3])\n\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1]\n parts[4] = submatch[2]\n parts[5] = undefined // no column when eval\n }\n\n return {\n args: parts[2] ? parts[2].split(',') : [],\n column: parts[5] ? +parts[5] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[4] ? +parts[4] : undefined,\n url: parts[3]\n }\n}\n\nfunction tryToGetString(candidate, property) {\n if (typeof candidate !== 'object' || !candidate || !(property in candidate)) {\n return undefined\n }\n var value = candidate[property]\n return typeof value === 'string' ? value : undefined\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAsC,SAAAC,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AACtC,IAAIK,gBAAgB,GAAG,GAAG;;AAE1B;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,EAAE,EAAE;EACpC,IAAIC,KAAK,GAAG,EAAE;EAEd,IAAIC,aAAa,GAAGC,cAAc,CAACH,EAAE,EAAE,OAAO,CAAC;EAC/C,IAAII,QAAQ,GAAGC,MAAM,CAACL,EAAE,CAAC;EACzB,IAAIE,aAAa,IAAIA,aAAa,CAACI,UAAU,CAACF,QAAQ,CAAC,EAAE;IACvDF,aAAa,GAAGA,aAAa,CAACK,KAAK,CAACH,QAAQ,CAACI,MAAM,CAAC;EACtD;EACA,IAAIN,aAAa,EAAE;IACjB,IAAAO,WAAI,EAACP,aAAa,CAACQ,KAAK,CAAC,IAAI,CAAC,EAAE,UAAUC,IAAI,EAAE;MAC9C,IAAIC,UAAU,GACZC,eAAe,CAACF,IAAI,CAAC,IACrBG,wBAAwB,CAACH,IAAI,CAAC,IAC9BI,YAAY,CAACJ,IAAI,CAAC,IAClBK,cAAc,CAACL,IAAI,CAAC;MACtB,IAAIC,UAAU,EAAE;QACd,IAAI,CAACA,UAAU,CAACK,IAAI,IAAIL,UAAU,CAACD,IAAI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AAGQ,SAAS;IACxCjB,IAAI,EAAES,KAAK,CAAC,CAAC,CAAC,IAAI5B,gBAAgB;IAClCa,IAAI,EAAEe,KAAK,CAAC,CAAC,CAAC,GAAG,CAACA,KAAK,CAAC,CAAC,CAAC,GAAGQ,SAAS;IACtCC,GAAG,EAAET,KAAK,CAAC,CAAC;EACd,CAAC;AACH;AAEA,SAASvB,cAAcA,CAACqC,SAAS,EAAEC,QAAQ,EAAE;EAC3C,IAAIjD,OAAA,CAAOgD,SAAS,MAAK,QAAQ,IAAI,CAACA,SAAS,IAAI,EAAEC,QAAQ,IAAID,SAAS,CAAC,EAAE;IAC3E,OAAON,SAAS;EAClB;EACA,IAAIQ,KAAK,GAAGF,SAAS,CAACC,QAAQ,CAAC;EAC/B,OAAO,OAAOC,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGR,SAAS;AACtD","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ function getEventBridge() {
|
|
|
24
24
|
return eventBridgeGlobal.getPrivacyLevel && eventBridgeGlobal.getPrivacyLevel();
|
|
25
25
|
},
|
|
26
26
|
getAllowedWebViewHosts: function getAllowedWebViewHosts() {
|
|
27
|
-
return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts());
|
|
27
|
+
return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts && eventBridgeGlobal.getAllowedWebViewHosts() || '[]');
|
|
28
28
|
},
|
|
29
29
|
send: function send(eventType, event, viewId) {
|
|
30
30
|
var view = viewId ? {
|
|
@@ -48,6 +48,13 @@ function bridgeSupports(capability) {
|
|
|
48
48
|
function canUseEventBridge() {
|
|
49
49
|
var _getGlobalObject$loca;
|
|
50
50
|
var currentHost = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_getGlobalObject$loca = (0, _init.getGlobalObject)().location) === null || _getGlobalObject$loca === void 0 ? void 0 : _getGlobalObject$loca.hostname;
|
|
51
|
+
var eventBridgeGlobal = getEventBridgeGlobal();
|
|
52
|
+
if (eventBridgeGlobal && eventBridgeGlobal.getAllowedWebViewHosts === undefined) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (eventBridgeGlobal && eventBridgeGlobal.getAllowedWebViewHosts && (eventBridgeGlobal.getAllowedWebViewHosts() === null || eventBridgeGlobal.getAllowedWebViewHosts() === undefined)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
51
58
|
var bridge = getEventBridge();
|
|
52
59
|
return !!bridge && bridge.getAllowedWebViewHosts().some(function (allowedHost) {
|
|
53
60
|
return currentHost === allowedHost || currentHost.endsWith(".".concat(allowedHost));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBridge.js","names":["_init","require","getEventBridgeGlobal","getGlobalObject","FTWebViewJavascriptBridge","getEventBridge","eventBridgeGlobal","getCapabilities","JSON","parse","getPrivacyLevel","getAllowedWebViewHosts","send","eventType","event","viewId","view","id","undefined","sendEvent","stringify","name","data","BridgeCapability","exports","RECORDS","bridgeSupports","capability","bridge","includes","canUseEventBridge","_getGlobalObject$loca","currentHost","arguments","length","location","hostname","some","allowedHost","endsWith","concat"],"sources":["../../src/transport/eventBridge.js"],"sourcesContent":["import { getGlobalObject } from '../init'\n\nfunction getEventBridgeGlobal() {\n return getGlobalObject().FTWebViewJavascriptBridge\n}\nexport function getEventBridge() {\n var eventBridgeGlobal = getEventBridgeGlobal()\n\n if (!eventBridgeGlobal) {\n return\n }\n\n return {\n getCapabilities() {\n return JSON.parse(\n (eventBridgeGlobal.getCapabilities &&\n eventBridgeGlobal.getCapabilities()) ||\n '[]'\n )\n },\n getPrivacyLevel() {\n return (\n eventBridgeGlobal.getPrivacyLevel && eventBridgeGlobal.getPrivacyLevel()\n )\n },\n getAllowedWebViewHosts() {\n return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts())\n },\n send(eventType, event, viewId) {\n const view = viewId ? { id: viewId } : undefined\n eventBridgeGlobal.sendEvent(\n JSON.stringify({ name: eventType, data: event, view })\n )\n }\n }\n}\nexport const BridgeCapability = {\n RECORDS: 'records'\n}\nexport function bridgeSupports(capability) {\n const bridge = getEventBridge()\n\n return !!bridge && bridge.getCapabilities().includes(capability)\n}\nexport function canUseEventBridge(\n currentHost = getGlobalObject().location?.hostname\n) {\n var bridge = getEventBridge()\n
|
|
1
|
+
{"version":3,"file":"eventBridge.js","names":["_init","require","getEventBridgeGlobal","getGlobalObject","FTWebViewJavascriptBridge","getEventBridge","eventBridgeGlobal","getCapabilities","JSON","parse","getPrivacyLevel","getAllowedWebViewHosts","send","eventType","event","viewId","view","id","undefined","sendEvent","stringify","name","data","BridgeCapability","exports","RECORDS","bridgeSupports","capability","bridge","includes","canUseEventBridge","_getGlobalObject$loca","currentHost","arguments","length","location","hostname","some","allowedHost","endsWith","concat"],"sources":["../../src/transport/eventBridge.js"],"sourcesContent":["import { getGlobalObject } from '../init'\n\nfunction getEventBridgeGlobal() {\n return getGlobalObject().FTWebViewJavascriptBridge\n}\nexport function getEventBridge() {\n var eventBridgeGlobal = getEventBridgeGlobal()\n\n if (!eventBridgeGlobal) {\n return\n }\n\n return {\n getCapabilities() {\n return JSON.parse(\n (eventBridgeGlobal.getCapabilities &&\n eventBridgeGlobal.getCapabilities()) ||\n '[]'\n )\n },\n getPrivacyLevel() {\n return (\n eventBridgeGlobal.getPrivacyLevel && eventBridgeGlobal.getPrivacyLevel()\n )\n },\n getAllowedWebViewHosts() {\n return JSON.parse(\n (eventBridgeGlobal.getAllowedWebViewHosts &&\n eventBridgeGlobal.getAllowedWebViewHosts()) ||\n '[]'\n )\n },\n send(eventType, event, viewId) {\n const view = viewId ? { id: viewId } : undefined\n eventBridgeGlobal.sendEvent(\n JSON.stringify({ name: eventType, data: event, view })\n )\n }\n }\n}\nexport const BridgeCapability = {\n RECORDS: 'records'\n}\nexport function bridgeSupports(capability) {\n const bridge = getEventBridge()\n\n return !!bridge && bridge.getCapabilities().includes(capability)\n}\nexport function canUseEventBridge(\n currentHost = getGlobalObject().location?.hostname\n) {\n const eventBridgeGlobal = getEventBridgeGlobal()\n if (\n eventBridgeGlobal &&\n eventBridgeGlobal.getAllowedWebViewHosts === undefined\n ) {\n return true\n }\n if (\n eventBridgeGlobal &&\n eventBridgeGlobal.getAllowedWebViewHosts &&\n (eventBridgeGlobal.getAllowedWebViewHosts() === null ||\n eventBridgeGlobal.getAllowedWebViewHosts() === undefined)\n ) {\n return true\n }\n var bridge = getEventBridge()\n return (\n !!bridge &&\n bridge\n .getAllowedWebViewHosts()\n .some(\n (allowedHost) =>\n currentHost === allowedHost || currentHost.endsWith(`.${allowedHost}`)\n )\n )\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO,IAAAC,qBAAe,EAAC,CAAC,CAACC,yBAAyB;AACpD;AACO,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAIC,iBAAiB,GAAGJ,oBAAoB,CAAC,CAAC;EAE9C,IAAI,CAACI,iBAAiB,EAAE;IACtB;EACF;EAEA,OAAO;IACLC,eAAe,WAAfA,eAAeA,CAAA,EAAG;MAChB,OAAOC,IAAI,CAACC,KAAK,CACdH,iBAAiB,CAACC,eAAe,IAChCD,iBAAiB,CAACC,eAAe,CAAC,CAAC,IACnC,IACJ,CAAC;IACH,CAAC;IACDG,eAAe,WAAfA,eAAeA,CAAA,EAAG;MAChB,OACEJ,iBAAiB,CAACI,eAAe,IAAIJ,iBAAiB,CAACI,eAAe,CAAC,CAAC;IAE5E,CAAC;IACDC,sBAAsB,WAAtBA,sBAAsBA,CAAA,EAAG;MACvB,OAAOH,IAAI,CAACC,KAAK,CACdH,iBAAiB,CAACK,sBAAsB,IACvCL,iBAAiB,CAACK,sBAAsB,CAAC,CAAC,IAC1C,IACJ,CAAC;IACH,CAAC;IACDC,IAAI,WAAJA,IAAIA,CAACC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAE;MAC7B,IAAMC,IAAI,GAAGD,MAAM,GAAG;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AAA,OACVN,WAAW,KAAKM,WAAW,IAAIN,WAAW,CAACO,QAAQ,KAAAC,MAAA,CAAKF,WAAW,CAAE,CAAC;EAAA,CAC1E,CAAC;AAEP","ignoreList":[]}
|
|
@@ -30,12 +30,14 @@ export function addEventListeners(eventTarget, eventNames, listener, options) {
|
|
|
30
30
|
capture: options.capture,
|
|
31
31
|
passive: options.passive
|
|
32
32
|
} : options && options.capture;
|
|
33
|
-
|
|
33
|
+
// Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)
|
|
34
|
+
var listenerTarget = window.EventTarget && eventTarget instanceof EventTarget ? window.EventTarget.prototype : eventTarget;
|
|
35
|
+
var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener');
|
|
34
36
|
each(eventNames, function (eventName) {
|
|
35
37
|
add.call(eventTarget, eventName, wrappedListener, options);
|
|
36
38
|
});
|
|
37
39
|
var stop = function stop() {
|
|
38
|
-
var remove = getZoneJsOriginalValue(
|
|
40
|
+
var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener');
|
|
39
41
|
each(eventNames, function (eventName) {
|
|
40
42
|
remove.call(eventTarget, eventName, wrappedListener, options);
|
|
41
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addEventListener.js","names":["each","getZoneJsOriginalValue","monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","once","stop","passive","capture","add","eventName","call","remove"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n var add = getZoneJsOriginalValue(
|
|
1
|
+
{"version":3,"file":"addEventListener.js","names":["each","getZoneJsOriginalValue","monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","once","stop","passive","capture","listenerTarget","window","EventTarget","prototype","add","eventName","call","remove"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)\n const listenerTarget =\n window.EventTarget && eventTarget instanceof EventTarget\n ? window.EventTarget.prototype\n : eventTarget\n var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener')\n\n each(eventNames, function (eventName) {\n add.call(eventTarget, eventName, wrappedListener, options)\n })\n var stop = function () {\n var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener')\n each(eventNames, function (eventName) {\n remove.call(eventTarget, eventName, wrappedListener, options)\n })\n }\n return {\n stop: stop\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AACtC,SAASC,sBAAsB,QAAQ,kCAAkC;AACzE,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,OAAO,SAASC,gBAAgBA,CAACC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EACtE,OAAOC,iBAAiB,CAACJ,WAAW,EAAE,CAACC,KAAK,CAAC,EAAEC,QAAQ,EAAEC,OAAO,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,iBAAiBA,CAACJ,WAAW,EAAEK,UAAU,EAAEH,QAAQ,EAAEC,OAAO,EAAE;EAC5E,IAAIG,eAAe,GAAGR,OAAO,CAC3BK,OAAO,IAAIA,OAAO,CAACI,IAAI,GACnB,UAAUN,KAAK,EAAE;IACfO,IAAI,CAAC,CAAC;IACNN,QAAQ,CAACD,KAAK,CAAC;EACjB,CAAC,GACDC,QACN,CAAC;EACDC,OAAO,GACLA,OAAO,IAAIA,OAAO,CAACM,OAAO,GACtB;IAAEC,OAAO,EAAEP,OAAO,CAACO,OAAO;IAAED,OAAO,EAAEN,OAAO,CAACM;EAAQ,CAAC,GACtDN,OAAO,IAAIA,OAAO,CAACO,OAAO;EAChC;EACA,IAAMC,cAAc,GAClBC,MAAM,CAACC,WAAW,IAAIb,WAAW,YAAYa,WAAW,GACpDD,MAAM,CAACC,WAAW,CAACC,SAAS,GAC5Bd,WAAW;EACjB,IAAIe,GAAG,GAAGlB,sBAAsB,CAACc,cAAc,EAAE,kBAAkB,CAAC;EAEpEf,IAAI,CAACS,UAAU,EAAE,UAAUW,SAAS,EAAE;IACpCD,GAAG,CAACE,IAAI,CAACjB,WAAW,EAAEgB,SAAS,EAAEV,eAAe,EAAEH,OAAO,CAAC;EAC5D,CAAC,CAAC;EACF,IAAIK,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAe;IACrB,IAAIU,MAAM,GAAGrB,sBAAsB,CAACc,cAAc,EAAE,qBAAqB,CAAC;IAC1Ef,IAAI,CAACS,UAAU,EAAE,UAAUW,SAAS,EAAE;MACpCE,MAAM,CAACD,IAAI,CAACjB,WAAW,EAAEgB,SAAS,EAAEV,eAAe,EAAEH,OAAO,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC;EACD,OAAO;IACLK,IAAI,EAAEA;EACR,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { addEventListener } from './addEventListener';
|
|
2
|
+
import { display } from '../helper/display';
|
|
3
|
+
import { trim } from '../configuration/transportConfiguration';
|
|
4
|
+
var timeOffset;
|
|
5
|
+
export function fetchAndApplyRemoteClocks(initConfiguration, callback) {
|
|
6
|
+
var start = performance.now();
|
|
7
|
+
fetchRemoteClocks(initConfiguration, function (serverTimestamp) {
|
|
8
|
+
var end = performance.now();
|
|
9
|
+
var rtt = end - start;
|
|
10
|
+
callback(applyRemoteClocks(serverTimestamp, rtt));
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function applyRemoteClocks(serverTimestamp, rtt) {
|
|
14
|
+
var estimatedClientTime = performance.timing.navigationStart + start + rtt / 2;
|
|
15
|
+
|
|
16
|
+
// 计算时间偏移
|
|
17
|
+
var offset = serverTimestamp - estimatedClientTime;
|
|
18
|
+
return offset;
|
|
19
|
+
}
|
|
20
|
+
export function fetchRemoteClocks(configuration, callback) {
|
|
21
|
+
var xhr = new XMLHttpRequest();
|
|
22
|
+
addEventListener(xhr, 'load', function () {
|
|
23
|
+
if (xhr.status === 200) {
|
|
24
|
+
var remoteConfiguration = JSON.parse(xhr.responseText);
|
|
25
|
+
callback(remoteConfiguration.content);
|
|
26
|
+
} else {
|
|
27
|
+
displayRemoteClocksFetchingError();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
addEventListener(xhr, 'error', function () {
|
|
31
|
+
callback({});
|
|
32
|
+
displayRemoteClocksFetchingError();
|
|
33
|
+
});
|
|
34
|
+
xhr.open('GET', buildEndpoint(configuration));
|
|
35
|
+
xhr.send();
|
|
36
|
+
}
|
|
37
|
+
export function buildEndpoint(configuration) {
|
|
38
|
+
var url = configuration.datakitOrigin || configuration.datakitUrl || configuration.site;
|
|
39
|
+
if (url.indexOf('/') === 0) {
|
|
40
|
+
// 绝对路径这种 /xxx
|
|
41
|
+
url = location.origin + trim(url);
|
|
42
|
+
}
|
|
43
|
+
var endpoint = url;
|
|
44
|
+
if (url.lastIndexOf('/') === url.length - 1) {
|
|
45
|
+
endpoint = trim(url) + 'v1/env_variable';
|
|
46
|
+
} else {
|
|
47
|
+
endpoint = trim(url) + '/v1/env_variable';
|
|
48
|
+
}
|
|
49
|
+
// 这里需要加上token和app_id
|
|
50
|
+
endpoint += '?app_id=' + configuration.applicationId;
|
|
51
|
+
//testing-openway.dataflux.cn/v1/env_variable?token=a47fb0cdddaa4561a90d941317cdbc0b&app_id=d1b454d0_22eb_11ef_9b66_95ca11aa2c6c&to_headless=true
|
|
52
|
+
if (configuration.site && configuration.clientToken) {
|
|
53
|
+
endpoint = endpoint + '&token=' + configuration.clientToken + '&to_headless=true';
|
|
54
|
+
}
|
|
55
|
+
return endpoint;
|
|
56
|
+
}
|
|
57
|
+
function displayRemoteClocksFetchingError() {
|
|
58
|
+
display.error('Error fetching the remote configuration.');
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=asyncClocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncClocks.js","names":["addEventListener","display","trim","timeOffset","fetchAndApplyRemoteClocks","initConfiguration","callback","start","performance","now","fetchRemoteClocks","serverTimestamp","end","rtt","applyRemoteClocks","estimatedClientTime","timing","navigationStart","offset","configuration","xhr","XMLHttpRequest","status","remoteConfiguration","JSON","parse","responseText","content","displayRemoteClocksFetchingError","open","buildEndpoint","send","url","datakitOrigin","datakitUrl","site","indexOf","location","origin","endpoint","lastIndexOf","length","applicationId","clientToken","error"],"sources":["../../src/browser/asyncClocks.js"],"sourcesContent":["import { addEventListener } from './addEventListener'\nimport { display } from '../helper/display'\nimport { trim } from '../configuration/transportConfiguration'\nlet timeOffset\nexport function fetchAndApplyRemoteClocks(initConfiguration, callback) {\n const start = performance.now()\n fetchRemoteClocks(initConfiguration, (serverTimestamp) => {\n const end = performance.now()\n const rtt = end - start\n callback(applyRemoteClocks(serverTimestamp, rtt))\n })\n}\nfunction applyRemoteClocks(serverTimestamp, rtt) {\n const estimatedClientTime =\n performance.timing.navigationStart + start + rtt / 2\n\n // 计算时间偏移\n const offset = serverTimestamp - estimatedClientTime\n return offset\n}\nexport function fetchRemoteClocks(configuration, callback) {\n const xhr = new XMLHttpRequest()\n\n addEventListener(xhr, 'load', function () {\n if (xhr.status === 200) {\n const remoteConfiguration = JSON.parse(xhr.responseText)\n callback(remoteConfiguration.content)\n } else {\n displayRemoteClocksFetchingError()\n }\n })\n\n addEventListener(xhr, 'error', function () {\n callback({})\n displayRemoteClocksFetchingError()\n })\n\n xhr.open('GET', buildEndpoint(configuration))\n xhr.send()\n}\n\nexport function buildEndpoint(configuration) {\n var url =\n configuration.datakitOrigin ||\n configuration.datakitUrl ||\n configuration.site\n if (url.indexOf('/') === 0) {\n // 绝对路径这种 /xxx\n url = location.origin + trim(url)\n }\n var endpoint = url\n if (url.lastIndexOf('/') === url.length - 1) {\n endpoint = trim(url) + 'v1/env_variable'\n } else {\n endpoint = trim(url) + '/v1/env_variable'\n }\n // 这里需要加上token和app_id\n endpoint += '?app_id=' + configuration.applicationId\n //testing-openway.dataflux.cn/v1/env_variable?token=a47fb0cdddaa4561a90d941317cdbc0b&app_id=d1b454d0_22eb_11ef_9b66_95ca11aa2c6c&to_headless=true\n if (configuration.site && configuration.clientToken) {\n endpoint =\n endpoint + '&token=' + configuration.clientToken + '&to_headless=true'\n }\n return endpoint\n}\n\nfunction displayRemoteClocksFetchingError() {\n display.error('Error fetching the remote configuration.')\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,IAAI,QAAQ,yCAAyC;AAC9D,IAAIC,UAAU;AACd,OAAO,SAASC,yBAAyBA,CAACC,iBAAiB,EAAEC,QAAQ,EAAE;EACrE,IAAMC,KAAK,GAAGC,WAAW,CAACC,GAAG,CAAC,CAAC;EAC/BC,iBAAiB,CAACL,iBAAiB,EAAE,UAACM,eAAe,EAAK;IACxD,IAAMC,GAAG,GAAGJ,WAAW,CAACC,GAAG,CAAC,CAAC;IAC7B,IAAMI,GAAG,GAAGD,GAAG,GAAGL,KAAK;IACvBD,QAAQ,CAACQ,iBAAiB,CAACH,eAAe,EAAEE,GAAG,CAAC,CAAC;EACnD,CAAC,CAAC;AACJ;AACA,SAASC,iBAAiBA,CAACH,eAAe,EAAEE,GAAG,EAAE;EAC/C,IAAME,mBAAmB,GACvBP,WAAW,CAACQ,MAAM,CAACC,eAAe,GAAGV,KAAK,GAAGM,GAAG,GAAG,CAAC;;EAEtD;EACA,IAAMK,MAAM,GAAGP,eAAe,GAAGI,mBAAmB;EACpD,OAAOG,MAAM;AACf;AACA,OAAO,SAASR,iBAAiBA,CAACS,aAAa,EAAEb,QAAQ,EAAE;EACzD,IAAMc,GAAG,GAAG,IAAIC,cAAc,CAAC,CAAC;EAEhCrB,gBAAgB,CAACoB,GAAG,EAAE,MAAM,EAAE,YAAY;IACxC,IAAIA,GAAG,CAACE,MAAM,KAAK,GAAG,EAAE;MACtB,IAAMC,mBAAmB,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAACM,YAAY,CAAC;MACxDpB,QAAQ,CAACiB,mBAAmB,CAACI,OAAO,CAAC;IACvC,CAAC,MAAM;MACLC,gCAAgC,CAAC,CAAC;IACpC;EACF,CAAC,CAAC;EAEF5B,gB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
|
|
22
22
|
browser_version_major: 'device.browser_version_major',
|
|
23
23
|
screen_size: 'device.screen_size',
|
|
24
24
|
network_type: 'device.network_type',
|
|
25
|
+
time_zone: 'device.time_zone',
|
|
25
26
|
device: 'device.device',
|
|
26
27
|
view_id: 'view.id',
|
|
27
28
|
view_referrer: 'view.referrer',
|
package/esm/dataMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","session_on_error_sample_rate","session_replay_on_error_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","sampled_for_error_replay","sampled_for_error_session","session_error_timestamp","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_time","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_id","resource_status","resource_status_group","resource_method","duration","resource_size","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_delivery_type","resource_type","resource_protocol","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","error_handling_stack","long_task","LONG_TASK","long_task_id","blocking_duration","first_ui_event_timestamp","render_start","style_and_layout_start","long_task_start_time","scripts","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","connectivity","runtime_env","usage","configuration","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.name', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n session_on_error_sample_rate:\n '_gc.configuration.session_on_error_sample_rate',\n session_replay_on_error_sample_rate:\n '_gc.configuration.session_replay_on_error_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n sampled_for_error_replay: 'session.sampled_for_error_replay',\n sampled_for_error_session: 'session.sampled_for_error_session',\n session_error_timestamp: 'session.error_timestamp_for_session',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_time: 'view.cumulative_layout_shift_time',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_id: 'resource.id',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_delivery_type: 'resource.delivery_type',\n resource_type: 'resource.type',\n resource_protocol: 'resource.protocol',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes'],\n error_handling_stack: ['string', 'error.handling_stack']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration',\n blocking_duration: 'long_task.blocking_duration',\n first_ui_event_timestamp: 'long_task.first_ui_event_timestamp',\n render_start: 'long_task.render_start',\n style_and_layout_start: 'long_task.style_and_layout_start',\n long_task_start_time: 'long_task.start_time',\n scripts: ['string', 'long_task.scripts']\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind'],\n connectivity: ['string', 'telemetry.connectivity'],\n runtime_env: ['string', 'telemetry.runtime_env'],\n usage: ['string', 'telemetry.usage'],\n configuration: ['string', 'telemetry.configuration']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message'],\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU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AAY,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC;MAClDC,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDC,KAAK,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;MACpCC,aAAa,EAAE,CAAC,QAAQ,EAAE,yBAAyB;IACrD;EACF,CAAC;EACDC,WAAW,EAAE;IACXnH,IAAI,EAAEhD,YAAY,CAACoK,MAAM;IACzBlH,IAAI,EAAE;MACJ+E,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxBmC,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpCzI,SAAS,EAAE,gBAAgB;MAC3B5B,OAAO,EAAE,SAAS;MAClBsJ,MAAM,EAAE;IACV,CAAC;IACDtG,MAAM,EAAE;MACNuG,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;MAC9BzB,aAAa,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;MAC1CC,WAAW,EAAE,CAAC,QAAQ,EAAE,aAAa;IACvC;EACF;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","time_zone","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","session_on_error_sample_rate","session_replay_on_error_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","sampled_for_error_replay","sampled_for_error_session","session_error_timestamp","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_time","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_id","resource_status","resource_status_group","resource_method","duration","resource_size","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_delivery_type","resource_type","resource_protocol","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","error_handling_stack","long_task","LONG_TASK","long_task_id","blocking_duration","first_ui_event_timestamp","render_start","style_and_layout_start","long_task_start_time","scripts","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","connectivity","runtime_env","usage","configuration","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n time_zone: 'device.time_zone',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.name', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n session_on_error_sample_rate:\n '_gc.configuration.session_on_error_sample_rate',\n session_replay_on_error_sample_rate:\n '_gc.configuration.session_replay_on_error_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n sampled_for_error_replay: 'session.sampled_for_error_replay',\n sampled_for_error_session: 'session.sampled_for_error_session',\n session_error_timestamp: 'session.error_timestamp_for_session',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_time: 'view.cumulative_layout_shift_time',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_id: 'resource.id',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_delivery_type: 'resource.delivery_type',\n resource_type: 'resource.type',\n resource_protocol: 'resource.protocol',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes'],\n error_handling_stack: ['string', 'error.handling_stack']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration',\n blocking_duration: 'long_task.blocking_duration',\n first_ui_event_timestamp: 'long_task.first_ui_event_timestamp',\n render_start: 'long_task.render_start',\n style_and_layout_start: 'long_task.style_and_layout_start',\n long_task_start_time: 'long_task.start_time',\n scripts: ['string', 'long_task.scripts']\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind'],\n connectivity: ['string', 'telemetry.connectivity'],\n runtime_env: ['string', 'telemetry.runtime_env'],\n usage: ['string', 'telemetry.usage'],\n configuration: ['string', 'telemetry.configuration']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message'],\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,SAAS,EAAE,kBAAkB;EAC7BC,MAAM,EAAE,eAAe;EACvBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EAAE;EACxBC,eAAe,EAAE;AACnB,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7B,OAAO,EAAE,SAAS;MAClBuJ,MAAM,EAAE;IACV,CAAC;IACDtG,MAAM,EAAE;MACNuG,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;MAC9BzB,aAAa,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;MAC1CC,WAAW,EAAE,CAAC,QAAQ,EAAE,aAAa;IACvC;EACF;AACF,CAAC","ignoreList":[]}
|
package/esm/helper/deviceInfo.js
CHANGED
|
@@ -228,6 +228,10 @@ var MethodLibrary = {
|
|
|
228
228
|
}();
|
|
229
229
|
return _this.language;
|
|
230
230
|
}),
|
|
231
|
+
getTimeZone: monitor(function () {
|
|
232
|
+
var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
233
|
+
return timeZone;
|
|
234
|
+
}),
|
|
231
235
|
// 浏览器信息
|
|
232
236
|
getBrowserInfo: monitor(function () {
|
|
233
237
|
var _this = this;
|
|
@@ -525,7 +529,8 @@ if (typeof window !== 'undefined') {
|
|
|
525
529
|
browserVersionMajor: MethodLibrary.getBrowserInfo().browserMajor,
|
|
526
530
|
screenSize: window.screen.width + '*' + window.screen.height,
|
|
527
531
|
networkType: MethodLibrary.getNetwork(),
|
|
528
|
-
device: MethodLibrary.getDeviceType()
|
|
532
|
+
device: MethodLibrary.getDeviceType(),
|
|
533
|
+
timeZone: MethodLibrary.getTimeZone()
|
|
529
534
|
};
|
|
530
535
|
}
|
|
531
536
|
export var deviceInfo = _deviceInfo;
|