applicationinsights-js
Advanced tools
Comparing version 0.23.2 to 0.23.4
@@ -26,3 +26,3 @@ <properties | ||
* [Overview of the API and examples](https://azure.microsoft.com/documentation/articles/app-insights-api-custom-events-metrics/) | ||
* Non-minified built code: [ai.js](http://az416426.vo.msecnd.net/scripts/a/ai.js) | ||
* Non-minified built code: [ai.js](https://az416426.vo.msecnd.net/scripts/a/ai.js) | ||
@@ -275,3 +275,3 @@ ## class AppInsights | ||
// The url from where the JS SDK will be downloaded. | ||
// Default '//az416426.vo.msecnd.net/scripts/a/ai.0.js' | ||
// Default 'https://az416426.vo.msecnd.net/scripts/a/ai.0.js' | ||
url: string; | ||
@@ -278,0 +278,0 @@ } |
@@ -0,1 +1,3 @@ | ||
/// <reference path="../JavaScriptSDK.Interfaces/IConfig.ts"/> | ||
/// <reference path="../JavaScriptSDK.Interfaces/IAppInsights.ts"/> | ||
define(["require", "exports"], function (require, exports) { | ||
@@ -8,4 +10,7 @@ "use strict"; | ||
var aiObject = window[AppInsightsModule.appInsightsName]; | ||
// Define a temporary method that queues-up a the real method call | ||
aiObject[name] = function () { | ||
// Capture the original arguments passed to the method | ||
var originalArguments = arguments; | ||
// If the queue is available, it means that the function wasn't yet replaced with actual function value | ||
if (aiObject.queue) { | ||
@@ -15,2 +20,3 @@ aiObject.queue.push(function () { return aiObject[name].apply(aiObject, originalArguments); }); | ||
else { | ||
// otheriwse execute the function | ||
aiObject[name].apply(aiObject, originalArguments); | ||
@@ -23,2 +29,3 @@ } | ||
var aiObject = window[AppInsightsModule.appInsightsName]; | ||
// capture initial cookie if possible | ||
try { | ||
@@ -52,2 +59,3 @@ aiObject.cookie = document.cookie; | ||
var aiObject = window[AppInsightsModule.appInsightsName]; | ||
// if script was previously downloaded and initialized, queue will be deleted, reinitialize it | ||
if (!aiObject.queue) { | ||
@@ -57,4 +65,5 @@ aiObject.queue = []; | ||
var scriptElement = document.createElement("script"); | ||
scriptElement.src = aiConfig.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js"; | ||
scriptElement.src = aiConfig.url || "https://az416426.vo.msecnd.net/scripts/a/ai.0.js"; | ||
document.head.appendChild(scriptElement); | ||
// collect global errors | ||
if (!aiConfig.disableExceptionTracking) { | ||
@@ -77,2 +86,3 @@ AppInsightsModule._createLazyMethod("_onerror"); | ||
downloadAndSetup: AppInsightsModule._download, | ||
// exposing it for unit tests only, not part of interface | ||
_defineLazyMethods: AppInsightsModule._defineLazyMethods | ||
@@ -93,1 +103,2 @@ }; | ||
}); | ||
//# sourceMappingURL=AppInsightsModule.js.map |
{ | ||
"name": "applicationinsights-js", | ||
"version": "0.23.2", | ||
"version": "0.23.4", | ||
"description": "Microsoft Application Insights JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "JavaScript/JavaScriptSDK.Module/AppInsightsModule.js", |
@@ -25,3 +25,3 @@ # Microsoft Application Insights JavaScript SDK | ||
var appInsights = window.appInsights || function (config) { | ||
function s(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, r = document, f = window, e = "script", o = r.createElement(e), i, u; for (o.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", r.getElementsByTagName(e)[0].parentNode.appendChild(o), t.cookie = r.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) s("track" + i.pop()); return config.disableExceptionTracking || (i = "onerror", s("_" + i), u = f[i], f[i] = function (config, r, f, e, o) { var s = u && u(config, r, f, e, o); return s !== !0 && t["_" + i](config, r, f, e, o), s }), t | ||
function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s=u.createElement(o),i,f;s.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(s);try{t.cookie=u.cookie}catch(h){}for(t.queue=[],i=["Event","Exception","Metric","PageView","Trace","Dependency"];i.length;)r("track"+i.pop());return r("setAuthenticatedUserContext"),r("clearAuthenticatedUserContext"),config.disableExceptionTracking||(i="onerror",r("_"+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t["_"+i](config,r,u,e,o),s}),t | ||
}({ | ||
@@ -28,0 +28,0 @@ instrumentationKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
358628
8
4183
0