-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]AppInsights not working in IE7 #1142
Comments
I suspect your getting some form of JS exception being thrown. And as a couple of side notes
We recently added ES3 support to allow the SDK to function on older browsers and in compatibility mode such as this... So you may want to consider upgrading -- but lets identify the error first. |
Nev,
Can you please provide url of the JS that I should be using? I just get a generic syntax error which I don’t see if I remove compatibility mode. The error is somewhere in this code and it is not clear what is not compatible:
AppInsightCli.AppendLine("}({").Append($"instrumentationKey: "{ConfigurationManager.AppSettings["AppInsights.Key"]}"")
.Append(",").AppendLine("disableCorrelationHeaders: false")
Thanks,
Tim
…Sent from my iPhone
On Dec 18, 2019, at 6:00 PM, Nev <notifications@github.com<mailto:notifications@github.com>> wrote:
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
I suspect your getting some form of JS exception being thrown.
Can you load the dev tools (F12) and see what errors are appearing on the console?
And as a couple of side notes
* You should be encoding the strings used in the StringBuilder as this might corrupt your script
* It looks like your using an older version as it's downloading from https://az416426.vo.msecnd.net/scripts/a/ai.0.js which appears to have an internal version of 0.7.2.0
* I also assume that this works in without forcing IE7 mode?
We recently added ES3 support to allow the SDK to function on older browsers and in compatibility mode such as this... So you may want to consider upgrading -- but lets identify the error first.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142?email_source=notifications&email_token=AOCLWUPL57NDI6ID7PPQKATQZKTRRA5CNFSM4J4QWRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHHY66I#issuecomment-567250809>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUIDIAT5BB36BR5X6QDQZKTRRANCNFSM4J4QWRFQ>.
|
The version you are using is now considered to be "legacy" and will not have any changes like this fixed. As such to continue getting the latest code and therefore ES3 (IE7/8) support you will need to upgrade to the new version/snipet which is documented in the readme (which includes the new CDN URL). - https://github.com/microsoft/ApplicationInsights-JS#snippet-setup-ignore-if-using-npm-setup On the error... Which is really the end of the snipet initialization (the pass the argments portion), so it could be any of the following
If you look at the end of the Readme, I've added a table of know ES3 incompatible JS functions which if used can cause this issue. And for any of your javascript you will also need to be aware of. |
Had some time so did a quick pass on the pasted snippet and it doesn't look like there are any ES3 usage issues, however, unless it's a copy/paste issue you do have something going on with quotes around this @ the end of the ai.0.js you have an escaped quote " \" ", but you are not escaping other quotes... |
This is what my javascript resolves to:
<script type="text/javascript">var appInsights = window.appInsights || function (a) {var sdkInstance="appInsightsSDK";window[sdkInstance]="appInsights";var aiName=window[sdkInstance],aisdk=window[aiName]||function(e){function n(e){t[e]=function(){var n=arguments;t.queue.push(function(){t[e].apply(t,n)})}}var t={config:e};t.initialize=!0;var i=document,a=window;setTimeout(function(){var n=i.createElement("script");n.src=e.url||"https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",i.getElementsByTagName("script")[0].parentNode.appendChild(n)});try{t.cookie=i.cookie}catch(e){}t.queue=[],t.version=2;for(var r=["Event","PageView","Exception","Trace","DependencyData","Metric","PageViewPerformance"];r.length;)n("track"+r.pop());n("startTrackPage"),n("stopTrackPage");var s="Track"+r[0];if(n("start"+s),n("stop"+s),n("addTelemetryInitializer"),n("setAuthenticatedUserContext"),n("clearAuthenticatedUserContext"),n("flush"),t.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4},!(!0===e.disableExceptionTracking||e.extensionConfig&&e.extensionConfig.ApplicationInsightsAnalytics&&!0===e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)){n("_"+(r="onerror"));var o=a[r];a[r]=function(e,n,i,a,s){var c=o&&o(e,n,i,a,s);return!0!==c&&t["_"+r]({message:e,url:n,lineNumber:i,columnNumber:a,error:s}),c},e.autoExceptionInstrumented=!0}return t}({
"instrumentationKey": "","disableCorrelationHeaders": false
});
I am getting syntax error still on this area: "instrumentationKey": "","disableCorrelationHeaders": false
From: Nev [mailto:notifications@github.com]
Sent: Wednesday, December 18, 2019 7:50 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Had some time so did a quick pass on the pasted snippet and it doesn't look like there are any ES3 usage issues, however, unless it's a copy/paste issue you do have something going on with quotes around this
.url || "https://az416426.vo.msecnd.net/scripts/a/ai.0.js\<https://az416426.vo.msecnd.net/scripts/a/ai.0.js%5C>", d.getElementsByTagName("script")[0].parentNode.appendChild(b) }); try { c.cookie = d.cookie
@ the end of the ai.0.js you have an escaped quote " " ", but your not escaping other quotes...
It might be somthing around this where later versions handle this better than IE7...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142?email_source=notifications&email_token=AOCLWUNXDE2SZONCI3273P3QZLAKZA5CNFSM4J4QWRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHH7YMA#issuecomment-567278640>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOO25UOW7T4ZLSVR23QZLAKZANCNFSM4J4QWRFQ>.
|
Sorry, here is actual script. Please ignore above. ` |
Thanks,
Issue 2)
|
As an expectation on timeframe, we won't get to or publish a fix for this until early 2020 as we are about to hit a lockdown period. Can you try rolling back to your v1 usage and remove the const? |
Thanks Nev, I think that might have done the trick. I am doing some testing to verify.
From: Nev [mailto:notifications@github.com]
Sent: Thursday, December 19, 2019 2:25 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
As an expectation on timeframe, we won't get to or publish a fix for this until early 2020 as we are about to hit a lockdown period.
Can you try rolling back to your v1 usage and remove the const?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142?email_source=notifications&email_token=AOCLWUJZJMRDXZLE2T5VZZDQZPC7DA5CNFSM4J4QWRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHKVBFQ#issuecomment-567627926>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOO77K6TFU6SQ5HSYLQZPC7DANCNFSM4J4QWRFQ>.
|
The issue with the v2.3 is that we have not yet published the IE8 compatibility bits (v 2.3.1) to the CDN. |
Version 2.3.1 does not throw and exceptions (during initialization) in IE7 and IE8 modes. |
I will keep version 1 until 2.3 is added to CDN. I am noticing that not all page views are logged when user is using IE. When they switched to Edge, all page views are tracked. |
I suspect these are events associated with unload of the browser (especially for safari and idevices), this has been addressed as part of #1080 which will be in the version 2.4 or greater (I created a beta version of this yesterday but we only published the npm package), I suspect this will be the end of Jan (maybe Feb) before 2.4 is published to the CDN. |
We have now published v 2.3.1 to the CDN so So this should address the above errors on IE7/8 |
Nev,
Thanks. I gave it a try and I am getting couple of javascript errors. Below are errors and the script I am using on my pages. Am I doing something incorrectly in script?
SCRIPT5007: Unable to get property 'push' of undefined or null reference
SCRIPT438: Object doesn't support property or method 'defineProperty'
File: ai.2.min.js, Line: 5, Column: 118792
<script type="text/javascript">var sdkInstance="appInsightsSDK";window[sdkInstance]="appInsights";var aiName=window[sdkInstance],aisdk=window[aiName]||function(e){function n(e){t[e]=function(){var n=arguments;t.queue.push(function(){t[e].apply(t,n)})}}var t={config:e};t.initialize=!0;var i=document,a=window;setTimeout(function(){var n=i.createElement("script");n.src=e.url||"https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",i.getElementsByTagName("script")[0].parentNode.appendChild(n)});try{t.cookie=i.cookie}catch(e){}t.queue=[],t.version=2;for(var r=["Event","PageView","Exception","Trace","DependencyData","Metric","PageViewPerformance"];r.length;)n("track"+r.pop());n("startTrackPage"),n("stopTrackPage");var s="Track"+r[0];if(n("start"+s),n("stop"+s),n("addTelemetryInitializer"),n("setAuthenticatedUserContext"),n("clearAuthenticatedUserContext"),n("flush"),t.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4},!(!0===e.disableExceptionTracking||e.extensionConfig&&e.extensionConfig.ApplicationInsightsAnalytics&&!0===e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)){n("_"+(r="onerror"));var o=a[r];a[r]=function(e,n,i,a,s){var c=o&&o(e,n,i,a,s);return!0!==c&&t["_"+r]({message:e,url:n,lineNumber:i,columnNumber:a,error:s}),c},e.autoExceptionInstrumented=!0}return t}({
instrumentationKey: "abcd12345555",disableCorrelationHeaders: false
});
sdkInstance.queue.push(function(){sdkInstance.context.addTelemetryInitializer(function (envelope) {var tags = envelope.tags;if (tags) {tags['ai.user.id'] = "TEST";}
var telemetryItem = envelope.data.baseData;if (envelope.name == Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {telemetryItem.name = "TEST";envelope.tags['ai.operation.name'] = telemetryItem.name;}
telemetryItem.properties = telemetryItem.properties || {};telemetryItem.properties["portal"] = "TEST";telemetryItem.properties["area"] = "TEST";telemetryItem.properties["zone"] = "Home";telemetryItem.properties["section"] = "TEST";});
var serverId = "8c6451949a9a164d818a472534c65f6a"; sdkInstance.context.operation.id = serverId;});
sdkInstance.trackPageView();</script>
From: Nev [mailto:notifications@github.com]
Sent: Tuesday, January 07, 2020 5:09 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
We have now published v 2.3.1 to the CDN so
https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js and
https://az416426.vo.msecnd.net/scripts/b/ai.2.js
now downloads v 2.3.1
So this should address the above errors on IE7/8
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142?email_source=notifications&email_token=AOCLWUJVOBDAJZ2SE3ED6PDQ4T4PFA5CNFSM4J4QWRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIKOVKY#issuecomment-571796139>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUJTNE3EN5HKYDZQFJ3Q4T4PFANCNFSM4J4QWRFQ>.
|
Ok, there are 2 issues identified here.
|
I was able to clear out first issue. I miscopied something from github.
For second issue, it is failing in init.js and going to catch block:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { ApplicationInsightsContainer } from "./ApplicationInsightsContainer";
export { Initialization as ApplicationInsights } from "./Initialization";
"use strict";
// should be global function that should load as soon as SDK loads
try {
// E2E sku on load initializes core and pipeline using snippet as input for configuration
// tslint:disable-next-line: no-var-keyword
var aiName;
if (typeof window !== "undefined" && typeof JSON !== "undefined") {
// get snippet or initialize to an empty object
aiName = window["appInsightsSDK"] || "appInsights";
if (window[aiName] !== undefined) {
// this is the typical case for browser+snippet
var snippet = window[aiName] || { version: 2.0 };
// overwrite snippet with full appInsights
// for 2.0 initialize only if required
if ((snippet.version === 2.0 && window[aiName].initialize) || snippet.version === undefined) {
ApplicationInsightsContainer.getAppInsights(snippet, snippet.version);
}
}
}
}
catch (e) {
// TODO: Find better place to warn to console when SDK initialization fails
if (console) {
console.warn('Failed to initialize AppInsights JS SDK for instance ' + aiName + e.message);
}
}
//# sourceMappingURL=Init.js.map
From: Nev [mailto:notifications@github.com]
Sent: Wednesday, January 08, 2020 1:22 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Ok, there are 2 issues identified here.
1. 'push' undefined
* This is a difference between the versions, to fix this you need to update the snippet that you burn on the page (copy the current from the readme) https://github.com/Microsoft/ApplicationInsights-JS#snippet-setup-(ignore-if-using-npm-setup)
1. The second is a problem with the way TypeScript or rollup is creating the module, while we appear to have fixed all of the ES3 issues in the script, at the very end of the module is the following line
Object.defineProperty(exports, '__esModule', { value: true });
The issue is that IE7 doesn't implement "defineProperty" while IE8 defines it but may throw, so this issue is specific to IE7.... Will need to dig into this a bit deeper as using the F12 for IE11 in IE7 mode it appears that IE is not letting the script run (even though it should work).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142?email_source=notifications&email_token=AOCLWUL3RYZFF3QRCMICPC3Q4YKVFA5CNFSM4J4QWRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEINP2OA#issuecomment-572194104>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUMIMHSQJZ7GQ2PMPWDQ4YKVFANCNFSM4J4QWRFQ>.
|
Yes, I dug into it and identified the root cause as that final Object.defineProperty() which is added by rollup (used to create the modules at the point of packaging) so we are going to need to post process the generated files to "fixup" this issue and release a new version -- I expect it will be a few weeks before I'll get to and fix this problem. |
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code.
- Provide packaging rollup plugins to replace and detect non-ES3 included code. - Remove Es3 checks from reactive-native
- Provide packaging rollup plugins to replace and detect non-ES3 included code. - Remove Es3 checks from reactive-native
Hi Tim, I don't have the history from the v1 -> v2 updates, but I grabbed your code and added some additional logging to see what was happening and ran it locally in edge, IE and IE in 7 emulation mode and it looks like the properties are present and it is populating the correct location (as far as I currently know) This shows that the aisdk.properties.context object exists and is being populated and during the telemetry initializer the value assigned for the traceId is populated. The new location for the values is located in the While the console.log is not showing anything in the tags [] looking at the network request that is sent it does include the values set. And when running in IE7 mode and debugging into the packaging the tags are also set. So I think it looks ok... context:{"sessionManager":{"logger":{"queue":[],"AIInternalMessagePrefix":"AITR","_messageCount":0,"_messageLogged":{}},"config":{},"automaticSession":{}},"application":{},"device":{"id":"browser","deviceClass":"Browser"},"internal":{"sdkVersion":"javascript:2.5.3"},"location":{},"user":{"isNewUser":true,"logger":{"queue":[],"AIInternalMessagePrefix":"AITR","_messageCount":0,"_messageLogged":{}},"config":{},"id":"7naqk","accountAcquisitionDate":"2020-03-25T19:19:49.586Z","accountId":null},"telemetryTrace":{"traceID":"ed81555338e9324393867494f2536b24","name":"/T:/IE7_Error.local.html"},"session":{}} var sdkInstance="appInsightsSDK"; |
Nev,
I am seeing infinite loop issue again after the recent update. When I deploy this to production, I don’t want to risk something breaking due to updates. Do you suggest I host the file instead of using the CDN? What is recommended?
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Wednesday, March 25, 2020 1:20 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Nothing obvious, the only recomendation I would have is around adding some additional checks for the following line, as this could evaluate to undefined depending on the source of the telemetry (e.g. for example a cross origin exception doesn't (currently) populate the envelope.data.baseData so this would block all exceptions of this type from being sent to the server)
var telemetryItem = envelope.data.baseData;
So either of these would work
var data = envelelope.data = envelelope.data || {};
var telemetryItem = data.baseData = data.baseData || {}
where this both assigns the local variable and the embedded envelope data with either the target (itself) or the new empty object.
Cheers
Nev
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUJM3UG2D5X6I4QUO6LRJI4NZANCNFSM4J4QWRFQ>.
|
Hi Tim, I'm not seeing the infinite loop issue with 2.5.3... I've tested multiple times locally on this. Can you change the url to the non-minified version, run it in the debugger (F12) and when it gets stuck in the loop press the pause link In normal situations it will be running the setInterval() for polling the queue each 10 seconds, but this is not the loop / deadlock issue... I did have 1 case where it seemed to lockup, but I just forced (Ctrl-F5) the current version to be re-fetched from the CDN rather than using the local cached version of the older release |
And to answer the questions (sorry missed that in previous response). Do you suggest I host the file instead of using the CDN? What is recommended?
The only real advantage of hosting on your own domain is that browsers don't need to perform the DNS lookup fir the different domain, however, browsers have limits in the number of connections (resources) they can download per domain, so multiple domains can actually help -- depending on the users bandwidth and where they are fetching the resources from. |
The IE browser just locks up and I am unable to debug. This morning I wasn’t having these issues. It seems like after the update was pushed, something went wrong.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Wednesday, March 25, 2020 4:20 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Hi Tim,
I'm not seeing the infinite loop issue with 2.5.3... I've tested multiple times locally on this.
Can you change the url to the non-minified version, run it in the debugger (F12) and when it gets stuck in the loop press the pause link
https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js => https://az416426.vo.msecnd.net/scripts/b/ai.2.js
In normal situations it will be running the setInterval() for polling the queue each 10 seconds, but this is not the loop / deadlock issue...
I did have 1 case where it seemed to lockup, but I just forced (Ctrl-F5) the current version to be re-fetched from the CDN rather than using the local cached version of the older release
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUJBQHYNUHR2I6GEBTTRJJRN3ANCNFSM4J4QWRFQ>.
|
What version is it showing at the top of the file, it should be 2.5.3, version 2.5.2 had the issue... https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js
|
Another question, when the browser locks up is IE doing a bunch of CPU usage? |
Nev,
I switched version to 2.4.4 and the browser no longer locks. So, that tells me that something is going with version 2.5.x.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Wednesday, March 25, 2020 5:39 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Another question, when the browser locks up is IE doing a bunch of CPU usage?
I just checked locally with IE11 running in IE7 compat mode and it's working fine.
Even when the previous version had the issue I found the browser itself didn't lock up it just burnt ~15% CPU and the debugger pause still worked (at least for me)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUPILOC4ZX7EHBMM3F3RJJ2XFANCNFSM4J4QWRFQ>.
|
Nev,
I am also noticing that for cases where page views are logged, the custom properties are not being set. Below is the way I am setting the properties. Did this change for version 2 as well? Also, I know you mentioned before that there is an issue with IE7 logging page views. Is there a workaround that can be done in the meantime until we get all of our pages converted?
aisdk.addTelemetryInitializer(function (envelope) {var tags = envelope.tags;if (tags) {tags['ai.user.id'] = "t.sorial";}var data = envelope.data || {};var telemetryItem = data.baseData || {};if (envelope.name == Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {telemetryItem.name = "_Matt-3/Setup/Subject Binder/Subject ID Format";envelope.tags['ai.operation.name'] = telemetryItem.name;}telemetryItem.properties = telemetryItem.properties || {};telemetryItem.properties["portal"] = "_Matt-3";telemetryItem.properties["area"] = "Setup";telemetryItem.properties["zone"] = "Subject Binder";telemetryItem.properties["section"] = "Subject ID Format";});var serverId = "d871d213250e664fb58560a247513d88";aisdk.properties.context.telemetryTrace.traceID = serverId;});
Thanks,
Tim Sorial
Sr. Software Engineer
From: Sorial, Timothy
Sent: Thursday, March 26, 2020 8:50 AM
To: 'microsoft/ApplicationInsights-JS' <reply@reply.github.com>
Subject: RE: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
Nev,
I switched version to 2.4.4 and the browser no longer locks. So, that tells me that something is going with version 2.5.x.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com<mailto:notifications@github.com>>
Sent: Wednesday, March 25, 2020 5:39 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com<mailto:ApplicationInsights-JS@noreply.github.com>>
Cc: Sorial, Timothy <t.sorial@medpace.com<mailto:t.sorial@medpace.com>>; Author <author@noreply.github.com<mailto:author@noreply.github.com>>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Another question, when the browser locks up is IE doing a bunch of CPU usage?
I just checked locally with IE11 running in IE7 compat mode and it's working fine.
Even when the previous version had the issue I found the browser itself didn't lock up it just burnt ~15% CPU and the debugger pause still worked (at least for me)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUPILOC4ZX7EHBMM3F3RJJ2XFANCNFSM4J4QWRFQ>.
|
Hi Tim, I'll try and answer your question, if I miss one just ping me again on it, but first a couple of questions from me.
Now to answer the questions
Custom Properties
|
Hi Nev,
It locks up in version 2.5.2 as well. 2.5.2 throws long run script error. For 2.5.3, the browser just hangs on loading page and doesn’t respond.
I am running IE11 with forced compatibility to IE7. Runtime environment is 64 bit, windows 10.
Do you have an example of how custom property can be set with the new version? I am trying to make sure I have the syntax correct.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Thursday, March 26, 2020 1:33 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Hi Tim,
I'll try and answer your question, if I miss one just ping me again on it, but first a couple of questions from me.
* Was it downloading v 2.5.3 and still locking up with that version (as opposed to 2.5.2)
* What is the runtime environment XP, 32 or 64 and assuming native IE 7 (not IE 11 running in emulation mode -- as I can no longer repro in this mode)? I want to spend a little bit of time trying to repro to find the issue if I can as we don't have the infrastructure to create hotfixes from older builds and the changes introduced in 2.5 will be further extended so I don't want to compound any issues.
Now to answer the questions
Page Views
* Assuming you are talking about local SPA (updating the url with '#' arguments) then there is no automatic solution as IE 7/8 doesn't support the onhashchange event. Your only option here is to add manual event firing (perhaps with just track) when you are manually changing the page view (in your controller / route manager -- depending on your JS framework).
Custom Properties
* As I'm not familiar with the locations in v1, I'm just looking at the current code and looking at the ITelemetryItem interface the answer looks like - yes, custom properties look like they are now on the data field (https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOOL5OEN5T6HSPDJBDRJOGTFANCNFSM4J4QWRFQ>.
|
Do you think this will help with hashchange event issue?
https://stackoverflow.com/questions/6833650/binding-hashchange-event-in-ie7-issue
Thanks,
Tim Sorial
Sr. Software Engineer
From: Sorial, Timothy
Sent: Thursday, March 26, 2020 2:34 PM
To: microsoft/ApplicationInsights-JS <reply@reply.github.com>; microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Author <author@noreply.github.com>
Subject: RE: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
Hi Nev,
It locks up in version 2.5.2 as well. 2.5.2 throws long run script error. For 2.5.3, the browser just hangs on loading page and doesn’t respond.
I am running IE11 with forced compatibility to IE7. Runtime environment is 64 bit, windows 10.
Do you have an example of how custom property can be set with the new version? I am trying to make sure I have the syntax correct.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com<mailto:notifications@github.com>>
Sent: Thursday, March 26, 2020 1:33 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com<mailto:ApplicationInsights-JS@noreply.github.com>>
Cc: Sorial, Timothy <t.sorial@medpace.com<mailto:t.sorial@medpace.com>>; Author <author@noreply.github.com<mailto:author@noreply.github.com>>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Hi Tim,
I'll try and answer your question, if I miss one just ping me again on it, but first a couple of questions from me.
* Was it downloading v 2.5.3 and still locking up with that version (as opposed to 2.5.2)
* What is the runtime environment XP, 32 or 64 and assuming native IE 7 (not IE 11 running in emulation mode -- as I can no longer repro in this mode)? I want to spend a little bit of time trying to repro to find the issue if I can as we don't have the infrastructure to create hotfixes from older builds and the changes introduced in 2.5 will be further extended so I don't want to compound any issues.
Now to answer the questions
Page Views
* Assuming you are talking about local SPA (updating the url with '#' arguments) then there is no automatic solution as IE 7/8 doesn't support the onhashchange event. Your only option here is to add manual event firing (perhaps with just track) when you are manually changing the page view (in your controller / route manager -- depending on your JS framework).
Custom Properties
* As I'm not familiar with the locations in v1, I'm just looking at the current code and looking at the ITelemetryItem interface the answer looks like - yes, custom properties look like they are now on the data field (https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOOL5OEN5T6HSPDJBDRJOGTFANCNFSM4J4QWRFQ>.
|
Also, currently none of our pages use # argument. Is this something that is used by app insights that requires support for onhashchangeevent?
Thanks,
Tim Sorial
Sr. Software Engineer
From: Sorial, Timothy
Sent: Thursday, March 26, 2020 3:10 PM
To: microsoft/ApplicationInsights-JS <reply@reply.github.com>; microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Author <author@noreply.github.com>
Subject: RE: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
Do you think this will help with hashchange event issue?
https://stackoverflow.com/questions/6833650/binding-hashchange-event-in-ie7-issue
Thanks,
Tim Sorial
Sr. Software Engineer
From: Sorial, Timothy
Sent: Thursday, March 26, 2020 2:34 PM
To: microsoft/ApplicationInsights-JS <reply@reply.github.com<mailto:reply@reply.github.com>>; microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com<mailto:ApplicationInsights-JS@noreply.github.com>>
Cc: Author <author@noreply.github.com<mailto:author@noreply.github.com>>
Subject: RE: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
Hi Nev,
It locks up in version 2.5.2 as well. 2.5.2 throws long run script error. For 2.5.3, the browser just hangs on loading page and doesn’t respond.
I am running IE11 with forced compatibility to IE7. Runtime environment is 64 bit, windows 10.
Do you have an example of how custom property can be set with the new version? I am trying to make sure I have the syntax correct.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com<mailto:notifications@github.com>>
Sent: Thursday, March 26, 2020 1:33 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com<mailto:ApplicationInsights-JS@noreply.github.com>>
Cc: Sorial, Timothy <t.sorial@medpace.com<mailto:t.sorial@medpace.com>>; Author <author@noreply.github.com<mailto:author@noreply.github.com>>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Hi Tim,
I'll try and answer your question, if I miss one just ping me again on it, but first a couple of questions from me.
* Was it downloading v 2.5.3 and still locking up with that version (as opposed to 2.5.2)
* What is the runtime environment XP, 32 or 64 and assuming native IE 7 (not IE 11 running in emulation mode -- as I can no longer repro in this mode)? I want to spend a little bit of time trying to repro to find the issue if I can as we don't have the infrastructure to create hotfixes from older builds and the changes introduced in 2.5 will be further extended so I don't want to compound any issues.
Now to answer the questions
Page Views
* Assuming you are talking about local SPA (updating the url with '#' arguments) then there is no automatic solution as IE 7/8 doesn't support the onhashchange event. Your only option here is to add manual event firing (perhaps with just track) when you are manually changing the page view (in your controller / route manager -- depending on your JS framework).
Custom Properties
* As I'm not familiar with the locations in v1, I'm just looking at the current code and looking at the ITelemetryItem interface the answer looks like - yes, custom properties look like they are now on the data field (https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOOL5OEN5T6HSPDJBDRJOGTFANCNFSM4J4QWRFQ>.
|
It locks up in version 2.5.2 as well. 2.5.2 throws long run script error. I am running IE11 with forced compatibility to IE7. Runtime environment is 64 bit, windows 10.
Do you think this will help with hashchange event issue?
Do you have an example of how custom property can be set with the new version? I am trying to make sure I have the syntax correct. |
Also, currently none of our pages use # argument. Is this something that is used by app insights that requires support for onhashchangeevent?
|
This is what I am using for JSON polyfil. https://github.com/douglascrockford/JSON-js
Also, when you get a chance please provide sample code to set telemetry custom property.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Thursday, March 26, 2020 3:39 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
It locks up in version 2.5.2 as well. 2.5.2 throws long run script error.
For 2.5.3, the browser just hangs on loading page and doesn’t respond.
I am running IE11 with forced compatibility to IE7. Runtime environment is 64 bit, windows 10.
* This is the same environment I was using and while 2.5.2 gave the long run script error (which is how I found and fixed it), I'm not seeing the same issue with 2.5.3 (i.e. it's working for me)
* I'm wondering whether this is related to the JSON poly fill you are using, can you provide a link to it (I don't remember which one I'm using), I've uploaded my simple test page to github
IE7-1142.20200326.zip<https://github.com/microsoft/ApplicationInsights-JS/files/4389544/IE7-1142.20200326.zip>
Do you think this will help with hashchange event issue?
https://stackoverflow.com/questions/6833650/binding-hashchange-event-in-ie7-issue
* Yes, but you will need to add you own code to the section that does the click and change your code to click this (or these) links. As App Insights won't be able to hook all of your clicks and it won't automatically hook to this link.
Do you have an example of how custom property can be set with the new version? I am trying to make sure I have the syntax correct.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUPIJOMCQLFBIWOAYNTRJOVM3ANCNFSM4J4QWRFQ>.
|
I updated my sample for that (sorry forgot to mention in my response). |
There are some typo's in the uploaded sample change telemetryItem to data for this section in the telemetryInitializer
And using this polyfill https://github.com/douglascrockford/JSON-js with my sample is working (no IE7 lockups) when running in IE7 emulation and v2.5.3. So the lockup doesn't appear to be App Insights related... I'm still spinning up a couple of XP Vm's (just having issues getting them online as XP for some strange reason doesn't have the Hyper-V network drivers :-) ) |
But, how come no lockups occur with version 2.4.4? For polyfill, I am using following minified version:
Json.js
if (typeof JSON !== "object") { JSON = {} } (function () { "use strict"; var rx_one = /^[\],:{}\s]*$/; var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g; var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; var rx_four = /(?:^|:|,)(?:\s*\[)+/g; var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; function f(n) { return n < 10 ? "0" + n : n } function this_value() { return this.valueOf() } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null }; Boolean.prototype.toJSON = this_value; Number.prototype.toJSON = this_value; String.prototype.toJSON = this_value } var gap; var indent; var meta; var rep; function quote(string) { rx_escapable.lastIndex = 0; return rx_escapable.test(string) ? '"' + string.replace(rx_escapable, function (a) { var c = meta[a]; return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + string + '"' } function str(key, holder) { var i; var k; var v; var length; var mind = gap; var partial; var value = holder[key]; if (value && typeof value === "object" && typeof value.toJSON === "function") { value = value.toJSON(key) } if (typeof rep === "function") { value = rep.call(holder, key, value) } switch (typeof value) { case "string": return quote(value); case "number": return isFinite(value) ? String(value) : "null"; case "boolean": case "null": return String(value); case "object": if (!value) { return "null" } gap += indent; partial = []; if (Object.prototype.toString.apply(value) === "[object Array]") { length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || "null" } v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]"; gap = mind; return v } if (rep && typeof rep === "object") { length = rep.length; for (i = 0; i < length; i += 1) { if (typeof rep[i] === "string") { k = rep[i]; v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } else { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}"; gap = mind; return v } } if (typeof JSON.stringify !== "function") { meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }; JSON.stringify = function (value, replacer, space) { var i; gap = ""; indent = ""; if (typeof space === "number") { for (i = 0; i < space; i += 1) { indent += " " } } else if (typeof space === "string") { indent = space } rep = replacer; if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) { throw new Error("JSON.stringify") } return str("", { "": value }) } } if (typeof JSON.parse !== "function") { JSON.parse = function (text, reviver) { var j; function walk(holder, key) { var k; var v; var value = holder[key]; if (value && typeof value === "object") { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v } else { delete value[k] } } } } return reviver.call(holder, key, value) } text = String(text); rx_dangerous.lastIndex = 0; if (rx_dangerous.test(text)) { text = text.replace(rx_dangerous, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) } if (rx_one.test(text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, ""))) { j = eval("(" + text + ")"); return typeof reviver === "function" ? walk({ "": j }, "") : j } throw new SyntaxError("JSON.parse") } } })();
cycle.js
if (typeof JSON.decycle !== "function") { JSON.decycle = function decycle(object, replacer) { "use strict"; var objects = new WeakMap; return function derez(value, path) { var old_path; var nu; if (replacer !== undefined) { value = replacer(value) } if (typeof value === "object" && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)) { old_path = objects.get(value); if (old_path !== undefined) { return { $ref: old_path } } objects.set(value, path); if (Array.isArray(value)) { nu = []; value.forEach(function (element, i) { nu[i] = derez(element, path + "[" + i + "]") }) } else { nu = {}; Object.keys(value).forEach(function (name) { nu[name] = derez(value[name], path + "[" + JSON.stringify(name) + "]") }) } return nu } return value }(object, "$") } } if (typeof JSON.retrocycle !== "function") { JSON.retrocycle = function retrocycle($) { "use strict"; var px = /^\$(?:\[(?:\d+|"(?:[^\\"\u0000-\u001f]|\\(?:[\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*")\])*$/; (function rez(value) { if (value && typeof value === "object") { if (Array.isArray(value)) { value.forEach(function (element, i) { if (typeof element === "object" && element !== null) { var path = element.$ref; if (typeof path === "string" && px.test(path)) { value[i] = eval(path) } else { rez(element) } } }) } else { Object.keys(value).forEach(function (name) { var item = value[name]; if (typeof item === "object" && item !== null) { var path = item.$ref; if (typeof path === "string" && px.test(path)) { value[name] = eval(path) } else { rez(item) } } }) } } })($); return $ } }
Regarding custom properties: If I were to want property called section added it would be done this way: data.section = “test”;
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Thursday, March 26, 2020 3:53 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
There are some typo's in the uploaded sample change telemetryItem to data for this section in the telemetryInitializer
if (envelope.name == Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {
data.name = "123Emily/Setup/Rule/Conditional Reporting & Alert";
envelope.tags['ai.operation.name'] = data.name;
}
And using this polyfill https://github.com/douglascrockford/JSON-js with my sample is working (no IE7 lockups) when running in IE7 emulation and v2.5.3. So the lockup doesn't appear to be App Insights related... I'm still spinning up a couple of XP Vm's (just having issues getting them online as XP for some strange reason doesn't have the Hyper-V network drivers :-) )
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUMLRHMW4AOFCBZ66CTRJOXBFANCNFSM4J4QWRFQ>.
|
I only used the json.js as the cycle.js contains several JS references that are not supported in IE7, specifically Object.keys() and value.forEach() where value is an array. As to why it doesn't lockup with 2.4.4 -- I don't have any answer to that as I can't repro any lockup with 2.5.3. Does my example still lockup on your computer? For the data.section = "test" yes this should work, but if you want an object you will need to create the object first. So something like |
Thanks Nev. I will try removing cycle.js and see if it helps. I will give you an update tomorrow. If I continue to have issues, are you open to having a Skype session?
Thanks,
Tim
…Sent from my iPhone
On Mar 26, 2020, at 5:21 PM, Nev <notifications@github.com<mailto:notifications@github.com>> wrote:
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
I only used the json.js as the cycle.js contains several JS references that are not supported in IE7, specifically Object.keys() and value.forEach() where value is an array.
As to why it doesn't lockup with 2.4.4 -- I don't have any answer to that as I can't repro any lockup with 2.5.3. Does my example still lockup on your computer?
For the data.section = "test" yes this should work, but if you want an object you will need to create the object first. So something like
data.section = "test";
data.props = {};
data.props.a = 1;
data.props.b = "b";
etc.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUKC3G3PSTHBVPWPN63RJPBNJANCNFSM4J4QWRFQ>.
|
Yep, if this is continuing that is probably the easiest path forward. Skype for business or teams is probably easier, I should be able setup a teams invite if you don't have an installation. |
I am still having issues. Are you available today or Monday? I use Teams so we can use that if you prefer.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Thursday, March 26, 2020 8:05 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
Yep, if this is continuing that is probably the easiest path forward. Skype for business or teams is probably easier, I should be able setup a teams invite if you don't have an installation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUOWKD3OMAZEVH2VAM3RJPUSRANCNFSM4J4QWRFQ>.
|
I couldn’t find good example to set telemetryitem name. If I set data.name, it is adds name as custom property.
Thanks,
Tim Sorial
Sr. Software Engineer
From: Nev <notifications@github.com>
Sent: Thursday, March 26, 2020 3:53 PM
To: microsoft/ApplicationInsights-JS <ApplicationInsights-JS@noreply.github.com>
Cc: Sorial, Timothy <t.sorial@medpace.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/ApplicationInsights-JS] [BUG]AppInsights not working in IE7 (#1142)
*This message was sent from outside the company. Please use caution when opening attachments or clicking any links in the email.*
There are some typo's in the uploaded sample change telemetryItem to data for this section in the telemetryInitializer
if (envelope.name == Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {
data.name = "123Emily/Setup/Rule/Conditional Reporting & Alert";
envelope.tags['ai.operation.name'] = data.name;
}
And using this polyfill https://github.com/douglascrockford/JSON-js with my sample is working (no IE7 lockups) when running in IE7 emulation and v2.5.3. So the lockup doesn't appear to be App Insights related... I'm still spinning up a couple of XP Vm's (just having issues getting them online as XP for some strange reason doesn't have the Hyper-V network drivers :-) )
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1142 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOCLWUMLRHMW4AOFCBZ66CTRJOXBFANCNFSM4J4QWRFQ>.
|
Hi Tim, I'm not sure exactly which "name" field (as there are multiple), but based on the telemetry initializer code you have I dug into the v2 code and tests and I believe the following is the solution / change. There are a bunch of other options as well where it can pick it up from the document.title or the baseData.target.
I tried looking you up on teams (using the email in this thread) but it looks like either thats not you teams id or your org has disabled external linking (setting in the admin portal of Office 365), so I'll send you an email with my details and we can then figure out a time. Cheers Nev |
Hi Nev, i read complete thread about appinsights in IE7 but i could not find any code which is compatible with IE7. |
I'm still investigating / trying to repro the issue that Tim is seeing on version 2.5.3 vs 2.4.4. In the short term Tim is using v 2.4.4 at least until I can repro / track down the issue. For IE7 to work you will need to use a JSON Polyfill and the current v2 should work, one of the things that I did find while on a Teams call with him was that while with my Simple Sample https://github.com/microsoft/ApplicationInsights-JS/files/4389544/IE7-1142.20200326.zip I was using the F12 Dev console with the Emulate IE7 while Tim's app requires the returning the meta tag forcing mode=IE7, which does seem to behave differently. In terms of the "could not find any code that is compatible with IE7" v2 should be as part of packaging into NPM and uploading to the CDN the rollup-es3 tools are using to rewrite and validate that we don't use non-IE8 (ES3) compatible javascript. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description/Screenshot
We are in the process of upgrading our pages to support multiple browsers. But, there are pages where we force compatibility to IE7. When we inject appinsight script into these pages, we get javascript syntax error. It would be appreciated if we can receive a workaround to get it working for our old pages until we roll out the new pages.
Steps to Reproduce
OS/Browser:IE 11 with forced compatibility to IE7
SDK Version [e.g. 22]:
How you initialized the SDK:
We are using below code to inject the appinsight script:
StringBuilder AppInsightCli = new StringBuilder();
AppInsightCli.Append("<script type="text/javascript">");
AppInsightCli.Append("var appInsights = window.appInsights || function (a) {");
AppInsightCli.Append("function b(a) { c[a] = function () { var b = arguments; c.queue.push(function () { c[a].apply(c, b) }) } } var c = { config: a }, d = document, e = window; setTimeout(function () { var b = d.createElement("script"); b.src = a.url || "https://az416426.vo.msecnd.net/scripts/a/ai.0.js\", d.getElementsByTagName("script")[0].parentNode.appendChild(b) }); try { c.cookie = d.cookie } catch (a) { } c.queue = []; for (var f = ["Event", "Exception", "Metric", "PageView", "Trace", "Dependency"]; f.length;)b("track" + f.pop()); if (b("setAuthenticatedUserContext"), b("clearAuthenticatedUserContext"), b("startTrackEvent"), b("stopTrackEvent"), b("startTrackPage"), b("stopTrackPage"), b("flush"), !a.disableExceptionTracking) { f = "onerror", b("" + f); var g = e[f]; e[f] = function (a, b, d, e, h) { var i = g && g(a, b, d, e, h); return !0 !== i && c["" + f](a, b, d, e, h), i } } return c");
AppInsightCli.AppendLine("}({").Append($"instrumentationKey: "{ConfigurationManager.AppSettings["AppInsights.Key"]}"")
.Append(",").AppendLine("disableCorrelationHeaders: false")
.AppendLine("});");
AppInsightCli.Append("window.appInsights = appInsights;");
AppInsightCli.Append("appInsights.queue.push(function(){");
AppInsightCli.Append("appInsights.context.addTelemetryInitializer(function (envelope) {");
AppInsightCli.Append("const tags = envelope.tags;");
AppInsightCli.Append("if (tags) {");
AppInsightCli.Append($"tags['ai.user.id'] = "{HttpContext.Current.User.Identity.Name.Split(new string[] { "\" }, StringSplitOptions.RemoveEmptyEntries).Last()}";").AppendLine("}");
AppInsightCli.Append("var telemetryItem = envelope.data.baseData;");
AppInsightCli.Append("if (envelope.name == Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) {");
AppInsightCli.Append($"telemetryItem.name = "{requestName}";");
AppInsightCli.Append($"envelope.tags['ai.operation.name'] = telemetryItem.name;");
AppInsightCli.AppendLine("}");
AppInsightCli.Append("telemetryItem.properties = telemetryItem.properties || {};");
AppInsightCli.Append($"telemetryItem.properties["portal"] = "{psetting.PortalName}";");
AppInsightCli.Append($"telemetryItem.properties["area"] = "{psetting.ActiveArea.AreaName}";");
AppInsightCli.Append($"telemetryItem.properties["zone"] = "{psetting.ActiveZone.ZoneName}";");
AppInsightCli.Append($"telemetryItem.properties["section"] = "{psetting.ActiveSection.SectionName}";");
Expected behavior
What's happening is that server requests are being logged but page views are not. We expect page view, user and session info to be logged.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: