[BUG] v2.8.1 with a Hosted IE environment fails to initialize for a hosted instance of IE #1822 (#1824)
[BUG] IE8 Support was broken by several components #1823
This commit is contained in:
Родитель
4e88f2104e
Коммит
d2dba2e3d8
|
@ -5,9 +5,9 @@ name: Node.js CI
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, beta ]
|
||||
branches: [ master, beta, Release2.7 ]
|
||||
pull_request:
|
||||
branches: [ master, beta ]
|
||||
branches: [ master, beta, Release2.7 ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
@ -13,10 +13,10 @@ name: "CodeQL"
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, beta ]
|
||||
branches: [ master, beta, Release2.7 ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master, beta ]
|
||||
branches: [ master, beta, Release2.7 ]
|
||||
schedule:
|
||||
- cron: '17 15 * * 2'
|
||||
|
||||
|
|
|
@ -261,3 +261,4 @@ aicore.tests.js*
|
|||
aicore.tests.d.ts
|
||||
ai.tests.d.ts
|
||||
/.vs
|
||||
/index.html
|
||||
|
|
|
@ -123,7 +123,6 @@ function addSnippetLoadingTimeEvent(AISKUPerfTest: any, endtime: number): void {
|
|||
createPerfEvent(AISKUPerfTest, "SDKInit", duration, true, `AppInsightsInit-Init: Script LoadingTime: ${duration} ms added`);
|
||||
}
|
||||
|
||||
|
||||
export class AISKUPerf extends AITestClass {
|
||||
public AISKUPerfTest: AppInsightsInitPerfTestClass;
|
||||
public perfMgr: any;
|
||||
|
@ -137,7 +136,6 @@ export class AISKUPerf extends AITestClass {
|
|||
public testInitialize() {
|
||||
try {
|
||||
this.AISKUPerfTest = new AppInsightsInitPerfTestClass();
|
||||
this.AISKUPerfTest.loadScriptOnInit = () => {return this._loadScriptOnInit();}
|
||||
Assert.ok(window["oneDS"], "oneDS exists");
|
||||
Assert.ok(window["Microsoft"]?.ApplicationInsights?.PerfMarkMeasureManager, "perfMgr exists");
|
||||
Assert.ok(window["Microsoft"]?.ApplicationInsights?.doPerf, "doPerf exists");
|
||||
|
@ -167,6 +165,7 @@ export class AISKUPerf extends AITestClass {
|
|||
this.testCaseAsync({
|
||||
name: "AppInsights AISKU perf Test",
|
||||
stepDelay: 10000,
|
||||
assertNoHooks: false,
|
||||
steps: [() => {
|
||||
Assert.ok(window["appInsightsInitPerftest"], "global appInsightsInitPerftest exists");
|
||||
Assert.ok(window["oneDS"], "oneDS exists");
|
||||
|
@ -199,16 +198,27 @@ export class AISKUPerf extends AITestClass {
|
|||
});
|
||||
}
|
||||
|
||||
protected _loadScriptOnInit(): void {
|
||||
protected _loadScriptOnInit(theModule: any): void {
|
||||
var snippetLoadingEndTime = performance.now();
|
||||
this._addMemoryPerfEvent(this.initialMemoryUsage);
|
||||
Assert.ok(true,"AppInsights script loaded");
|
||||
|
||||
addSnippetLoadingTimeEvent(this.AISKUPerfTest,snippetLoadingEndTime);
|
||||
addSnippetLoadingTimeEvent(this.AISKUPerfTest, snippetLoadingEndTime);
|
||||
|
||||
let appInsights = window["appInsights"];
|
||||
this.appInsights = appInsights;
|
||||
|
||||
this.onDone(() => {
|
||||
if (appInsights && appInsights.unload && appInsights.core && appInsights.core.isInitialized()) {
|
||||
Assert.ok(true, "Unloading...");
|
||||
appInsights.unload(false);
|
||||
} else {
|
||||
Assert.ok(true, "Unload not supported...");
|
||||
}
|
||||
|
||||
appInsights = null;
|
||||
this.appInsights = null;
|
||||
});
|
||||
try {
|
||||
let notificationManager = this.appInsights.core["_notificationManager"] ||this.appInsights.core?.getNotifyMgr();
|
||||
if (notificationManager) {
|
||||
|
@ -230,29 +240,31 @@ export class AISKUPerf extends AITestClass {
|
|||
}
|
||||
|
||||
protected _loadSnippet():void {
|
||||
this.initialMemoryUsage = performance["memory"]?.usedJSHeapSize;
|
||||
var tag = document.createElement("script");
|
||||
tag.innerText = this.getSnippet();
|
||||
this.AISKUPerfTest.snippetStartTime = performance.now();
|
||||
document.getElementsByTagName("head")[0].appendChild(tag);
|
||||
}
|
||||
let self = this;
|
||||
self.initialMemoryUsage = performance["memory"]?.usedJSHeapSize;
|
||||
window["loadSdkUsingRequire"]({
|
||||
src: self.getScriptSrc(),
|
||||
onInit: function (theInstance) {
|
||||
console.log("snippet loaded");
|
||||
self._loadScriptOnInit(theInstance);
|
||||
|
||||
public getSnippet(): string {
|
||||
return `
|
||||
loadSdkUsingRequire({
|
||||
src: "https://js.monitor.azure.com/scripts/b/ai.${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}",
|
||||
onInit: function (appInsights) {
|
||||
console.log("snippet loaded");
|
||||
appInsightsInitPerftest.loadScriptOnInit();
|
||||
},
|
||||
cfg: {
|
||||
instrumentationKey: "key",
|
||||
enablePerfMgr: true,
|
||||
maxBatchSizeInBytes: 1000000,
|
||||
maxBatchInterval: 30000000,
|
||||
extensionConfig: {}
|
||||
}
|
||||
});`;
|
||||
self.onDone(() => {
|
||||
if (theInstance && theInstance.unload && theInstance.core && theInstance.core.isInitialized()) {
|
||||
Assert.ok(true, "Unloading from onInit...");
|
||||
theInstance.unload(false);
|
||||
} else {
|
||||
Assert.ok(true, "Unload not supported in onInit...");
|
||||
}
|
||||
});
|
||||
},
|
||||
cfg: {
|
||||
instrumentationKey: "key",
|
||||
enablePerfMgr: true,
|
||||
maxBatchSizeInBytes: 1000000,
|
||||
maxBatchInterval: 30000000,
|
||||
extensionConfig: {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public addPerfEvents() {
|
||||
|
@ -277,8 +289,14 @@ export class AISKUPerf extends AITestClass {
|
|||
}
|
||||
|
||||
public getScriptSrc(): string {
|
||||
return `https://js.monitor.azure.com/scripts/b/ai.${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}`;
|
||||
}
|
||||
let baseUrl = "https://js.monitor.azure.com/scripts/b/ai.";
|
||||
|
||||
if (this.AISKUPerfTest.version.indexOf("nightly") !== -1) {
|
||||
baseUrl = "https://js.monitor.azure.com/nightly/ai.";
|
||||
}
|
||||
|
||||
return baseUrl + `${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}`;
|
||||
}
|
||||
|
||||
private _addMemoryPerfEvent(initialMemoryUsage: number, metric?: string): void {
|
||||
let curMemory = performance["memory"]?.usedJSHeapSize;
|
||||
|
|
|
@ -55,7 +55,9 @@
|
|||
};
|
||||
|
||||
if (snippetCfg.onInit) {
|
||||
appInsights.queue.push(snippetCfg.onInit);
|
||||
appInsights.queue.push(function() {
|
||||
snippetCfg.onInit(appInsights);
|
||||
});
|
||||
}
|
||||
|
||||
window["appInsights"] = appInsights;
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-analytics-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-channel-js": "2.8.1",
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
IEventTelemetry, IEnvelope, ProcessLegacy
|
||||
} from "@microsoft/applicationinsights-common";
|
||||
import { Snippet, Initialization as ApplicationInsights } from "./Initialization";
|
||||
import { ITelemetryItem, IDiagnosticLogger, IConfiguration, proxyAssign, throwError, ICookieMgr } from "@microsoft/applicationinsights-core-js";
|
||||
import { ITelemetryItem, IDiagnosticLogger, IConfiguration, proxyAssign, throwError, ICookieMgr, arrIndexOf } from "@microsoft/applicationinsights-core-js";
|
||||
|
||||
// This is an exclude list of properties that should not be updated during initialization
|
||||
// They include a combination of private and internal property names
|
||||
|
@ -187,7 +187,7 @@ export class AppInsightsDeprecated implements IAppInsightsDeprecated {
|
|||
// Note: This must be called before loadAppInsights is called
|
||||
proxyAssign(snippet, this, (name: string) => {
|
||||
// Not excluding names prefixed with "_" as we need to proxy some functions like _onError
|
||||
return name && _ignoreUpdateSnippetProperties.indexOf(name) === -1;
|
||||
return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
IChannelControls, hasWindow, hasDocument, isReactNative, doPerf, IDiagnosticLogger, INotificationManager, objForEachKey, proxyAssign, proxyFunctions,
|
||||
arrForEach, isString, isFunction, isNullOrUndefined, isArray, throwError, ICookieMgr, addPageUnloadEventListener, addPageHideEventListener,
|
||||
createUniqueNamespace, ITelemetryPlugin, IPlugin, ILoadedPlugin, UnloadHandler, removePageUnloadEventListener, removePageHideEventListener,
|
||||
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace, _throwInternal
|
||||
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace, _throwInternal, arrIndexOf
|
||||
} from "@microsoft/applicationinsights-core-js";
|
||||
import { AnalyticsPlugin, ApplicationInsights } from "@microsoft/applicationinsights-analytics-js";
|
||||
import { Sender } from "@microsoft/applicationinsights-channel-js";
|
||||
|
@ -235,7 +235,7 @@ export class Initialization implements IApplicationInsights {
|
|||
if (isString(field) &&
|
||||
!isFunction(value) &&
|
||||
field && field[0] !== "_" && // Don't copy "internal" values
|
||||
_ignoreUpdateSnippetProperties.indexOf(field) === -1) {
|
||||
arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) {
|
||||
snippet[field as string] = value;
|
||||
}
|
||||
});
|
||||
|
@ -277,7 +277,7 @@ export class Initialization implements IApplicationInsights {
|
|||
// Note: This must be called before loadAppInsights is called
|
||||
proxyAssign(snippet, _self, (name: string) => {
|
||||
// Not excluding names prefixed with "_" as we need to proxy some functions like _onError
|
||||
return name && _ignoreUpdateSnippetProperties.indexOf(name) === -1;
|
||||
return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
"@microsoft/applicationinsights-channel-js": "2.8.1",
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1"
|
||||
|
|
|
@ -49,6 +49,6 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
"@microsoft/dynamicproto-js": "^1.1.5"
|
||||
}
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -51,7 +51,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1"
|
||||
|
|
|
@ -710,7 +710,7 @@ export class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights
|
|||
));
|
||||
}
|
||||
}
|
||||
}));
|
||||
}, false));
|
||||
|
||||
_autoExceptionInstrumented = true;
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ export class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights
|
|||
_dispatchEvent(win, createDomEvent(extConfig.namePrefix + "locationchange"));
|
||||
}
|
||||
}
|
||||
}));
|
||||
}, true));
|
||||
|
||||
_addHook(InstrumentEvent(history, "replaceState", {
|
||||
ns: _evtNamespace,
|
||||
|
@ -799,7 +799,7 @@ export class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights
|
|||
_dispatchEvent(win, createDomEvent(extConfig.namePrefix + "locationchange"));
|
||||
}
|
||||
}
|
||||
}));
|
||||
}, true));
|
||||
|
||||
eventOn(win, extConfig.namePrefix + "popstate", _popstateHandler, _evtNamespace);
|
||||
eventOn(win, extConfig.namePrefix + "locationchange", _locationChangeHandler, _evtNamespace);
|
||||
|
@ -827,7 +827,7 @@ export class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights
|
|||
));
|
||||
}
|
||||
}
|
||||
}));
|
||||
}, false));
|
||||
|
||||
_autoUnhandledPromiseInstrumented = true;
|
||||
extConfig.autoUnhandledPromiseInstrumented = _autoUnhandledPromiseInstrumented;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1"
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
BaseTelemetryPlugin, IConfiguration, arrForEach,
|
||||
IAppInsightsCore, IPlugin, ITelemetryItem, IProcessTelemetryContext, _InternalLogMessage,
|
||||
ITelemetryPluginChain, InstrumentFunc, IInstrumentCallDetails, InstrumentorHooksCallback, IPerfEvent, IChannelControls,
|
||||
objForEachKey, isFunction, dateNow, isArray, isUndefined, getDebugExt
|
||||
objForEachKey, isFunction, dateNow, isArray, isUndefined, getDebugExt, arrIndexOf
|
||||
} from "@microsoft/applicationinsights-core-js";
|
||||
import { Dashboard } from "./components/Dashboard";
|
||||
import { getTargetName } from "./components/helpers";
|
||||
|
@ -162,16 +162,16 @@ export default class DebugPlugin extends BaseTelemetryPlugin {
|
|||
}
|
||||
});
|
||||
|
||||
if (trackers.indexOf("eventsSent") !== -1) {
|
||||
if (arrIndexOf(trackers, "eventsSent") !== -1) {
|
||||
foundTrackers.push("eventsSent");
|
||||
}
|
||||
if (trackers.indexOf("eventsSendRequest") !== -1) {
|
||||
if (arrIndexOf(trackers, "eventsSendRequest") !== -1) {
|
||||
foundTrackers.push("eventsSendRequest");
|
||||
}
|
||||
if (trackers.indexOf("eventsDiscarded") !== -1) {
|
||||
if (arrIndexOf(trackers, "eventsDiscarded") !== -1) {
|
||||
foundTrackers.push("eventsDiscarded");
|
||||
}
|
||||
if (trackers.indexOf("perfEvent") !== -1) {
|
||||
if (arrIndexOf(trackers, "perfEvent") !== -1) {
|
||||
foundTrackers.push("perfEvent");
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ export default class DebugPlugin extends BaseTelemetryPlugin {
|
|||
}, true);
|
||||
|
||||
if (val) {
|
||||
if (foundTrackers.indexOf(tracker) === -1) {
|
||||
if (arrIndexOf(foundTrackers, tracker) === -1) {
|
||||
foundTrackers.push(tracker);
|
||||
}
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ export default class DebugPlugin extends BaseTelemetryPlugin {
|
|||
}
|
||||
|
||||
function _addTarget(targetObjects: any[], ext:any) {
|
||||
if (ext && targetObjects.indexOf(ext) === -1) {
|
||||
if (ext && arrIndexOf(targetObjects, ext) === -1) {
|
||||
targetObjects.push(ext);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { arrForEach } from "@microsoft/applicationinsights-core-js";
|
||||
import { arrForEach, arrIndexOf } from "@microsoft/applicationinsights-core-js";
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { tempStyle } from "./styleNodeSrc";
|
||||
import { FilterList } from "./filterList";
|
||||
|
@ -138,11 +138,11 @@ export class Dashboard {
|
|||
}
|
||||
|
||||
let type = entry.getKind();
|
||||
let allowOther = excludedTypes.indexOf("other") === -1; // Other types are not excluded
|
||||
if (trackers.indexOf(type) === -1 && !allowOther) {
|
||||
let allowOther = arrIndexOf(excludedTypes, "other") === -1; // Other types are not excluded
|
||||
if (arrIndexOf(trackers, type) === -1 && !allowOther) {
|
||||
// Not a tracked type and we are not allowing other types
|
||||
return;
|
||||
} else if (excludedTypes.indexOf(type) !== -1) {
|
||||
} else if (arrIndexOf(excludedTypes, type) !== -1) {
|
||||
// This type is explicitly excluded
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
import { arrIndexOf } from "@microsoft/applicationinsights-core-js";
|
||||
|
||||
export class FilterList {
|
||||
|
||||
private el: HTMLElement;
|
||||
|
@ -70,7 +72,7 @@ export class FilterList {
|
|||
(ch.childNodes[0] as HTMLElement).className = "checkbox off";
|
||||
}
|
||||
}
|
||||
_self.filterList.splice(_self.filterList.indexOf(t), 1);
|
||||
_self.filterList.splice(arrIndexOf(_self.filterList, t), 1);
|
||||
checkbox.className = "checkbox on";
|
||||
} else {
|
||||
if (evt.shiftKey) {
|
||||
|
|
|
@ -233,7 +233,7 @@ export function getTargetKeys(target: any, excludedKeys: string[], includeFuncti
|
|||
if (propKeys) {
|
||||
arrForEach(propKeys, (key) => {
|
||||
const theKey = _toString(key);
|
||||
if (theKey && keys.indexOf(theKey) === -1) {
|
||||
if (theKey && arrIndexOf(keys, theKey) === -1) {
|
||||
keys.push(key);
|
||||
}
|
||||
});
|
||||
|
@ -253,7 +253,7 @@ export function getTargetKeys(target: any, excludedKeys: string[], includeFuncti
|
|||
}
|
||||
|
||||
const theKey = _toString(key);
|
||||
if (theKey && excludedKeys.indexOf(theKey) === -1) {
|
||||
if (theKey && arrIndexOf(excludedKeys, theKey) === -1) {
|
||||
theKeys.push(theKey);
|
||||
}
|
||||
});
|
||||
|
@ -305,7 +305,7 @@ export function formatLogElements(target: Object, tmLabel: string, key: string,
|
|||
keys.unshift("<maxdepth>");
|
||||
}
|
||||
for (const key of keys) {
|
||||
if (excludeKeys.indexOf(key) !== -1) {
|
||||
if (arrIndexOf(excludeKeys, key) !== -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1"
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1"
|
||||
},
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1"
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
"@microsoft/dynamicproto-js": "^1.1.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*",
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
"@microsoft/dynamicproto-js": "^1.1.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*",
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
"@microsoft/dynamicproto-js": "^1.1.5"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ import {
|
|||
dateNow, uaDisallowsSameSiteNone, disableCookies as coreDisableCookies,
|
||||
canUseCookies as coreCanUseCookies, getCookie as coreGetCookie,
|
||||
setCookie as coreSetCookie, deleteCookie as coreDeleteCookie,
|
||||
isBeaconsSupported
|
||||
isBeaconsSupported,
|
||||
arrIndexOf
|
||||
} from "@microsoft/applicationinsights-core-js";
|
||||
import { eRequestHeaders, RequestHeaders } from "./RequestResponseHeaders";
|
||||
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
||||
|
@ -28,7 +29,7 @@ const _internalEndpoints: string[] = [
|
|||
];
|
||||
|
||||
export function isInternalApplicationInsightsEndpoint(endpointUrl: string): boolean {
|
||||
return _internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1;
|
||||
return arrIndexOf(_internalEndpoints, endpointUrl.toLowerCase()) !== -1;
|
||||
}
|
||||
|
||||
export interface IUtil {
|
||||
|
|
|
@ -62,6 +62,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
"@microsoft/dynamicproto-js": "^1.1.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@ import { ICookieMgr } from "../JavaScriptSDK.Interfaces/ICookieMgr";
|
|||
import { createCookieMgr } from "./CookieMgr";
|
||||
import {
|
||||
arrForEach, isNullOrUndefined, getSetValue, setValue, isNotTruthy, isFunction, objExtend, objFreeze, proxyFunctionAs, proxyFunctions, throwError,
|
||||
toISOString
|
||||
toISOString,
|
||||
arrIndexOf
|
||||
} from "./HelperFuncs";
|
||||
import { strExtensionConfig, strIKey } from "./Constants";
|
||||
import { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from "./DiagnosticLogger";
|
||||
|
@ -503,12 +504,12 @@ export class BaseCore implements IAppInsightsCore {
|
|||
// But we also want the controller as the last, so remove if already present
|
||||
// And reusing the existing instance, just in case an installed plugin has a reference and
|
||||
// is using it.
|
||||
let idx = allExtensions.indexOf(_channelControl);
|
||||
let idx = arrIndexOf(allExtensions, _channelControl);
|
||||
if (idx !== -1) {
|
||||
allExtensions.splice(idx, 1);
|
||||
}
|
||||
|
||||
idx = _coreExtensions.indexOf(_channelControl);
|
||||
idx = arrIndexOf(_coreExtensions, _channelControl);
|
||||
if (idx !== -1) {
|
||||
_coreExtensions.splice(idx, 1);
|
||||
}
|
||||
|
@ -595,7 +596,7 @@ export class BaseCore implements IAppInsightsCore {
|
|||
let extensions = (_coreExtensions || []).slice();
|
||||
|
||||
// During add / remove this may get called again, so don't readd if already present
|
||||
if (extensions.indexOf(_telemetryInitializerPlugin) === -1) {
|
||||
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
||||
extensions.push(_telemetryInitializerPlugin);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration"
|
||||
import { _InternalMessageId, _eInternalMessageId, LoggingSeverity, eLoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
|
||||
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
||||
import { hasJSON, getJSON, getConsole } from "./EnvUtils";
|
||||
import { hasJSON, getJSON, getConsole, dumpObj } from "./EnvUtils";
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { isFunction, isNullOrUndefined, isUndefined } from "./HelperFuncs";
|
||||
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
||||
|
@ -123,7 +123,7 @@ export class DiagnosticLogger implements IDiagnosticLogger {
|
|||
const message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
||||
|
||||
if (_self.enableDebugExceptions()) {
|
||||
throw message;
|
||||
throw dumpObj(message);
|
||||
} else {
|
||||
// Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist
|
||||
let logFunc = severity === eLoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
||||
|
|
|
@ -132,7 +132,7 @@ function _createFunctionHook(aiHook:IInstrumentHooks) {
|
|||
|
||||
|
||||
/** @ignore */
|
||||
function _getOwner(target:any, name:string, checkPrototype:boolean): any {
|
||||
function _getOwner(target:any, name:string, checkPrototype: boolean): any {
|
||||
let owner = null;
|
||||
if (target) {
|
||||
if (hasOwnProperty(target, name)) {
|
||||
|
@ -266,9 +266,9 @@ export function InstrumentFuncs(target:any, funcNames:string[], callbacks: IInst
|
|||
* @param callbacks - The callbacks to configure and call whenever the function is called
|
||||
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
||||
*/
|
||||
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype:boolean = true): IInstrumentHook {
|
||||
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook {
|
||||
if (target && evtName && callbacks) {
|
||||
let owner = _getOwner(target, evtName, checkPrototype);
|
||||
let owner = _getOwner(target, evtName, checkPrototype) || target;
|
||||
if (owner) {
|
||||
return _createInstrumentHook(owner, evtName, owner[evtName], callbacks);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
"@microsoft/applicationinsights-core-js": "2.8.1",
|
||||
"@microsoft/applicationinsights-common": "2.8.1",
|
||||
"@microsoft/applicationinsights-shims": "2.0.1",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/dynamicproto-js": "^1.1.5",
|
||||
"file-saver": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
|
|
Загрузка…
Ссылка в новой задаче