-
Notifications
You must be signed in to change notification settings - Fork 241
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
Include prefix.js into Microsoft.ApplicationInsights.JavaScript #75
Comments
The snippet.html file does not seem to be checked-in, although it is referred to in the NuGet.JavaScript.csproj project as In fact the JavaScriptSDK.csproj project does not seem to load either. |
See https://github.com/Microsoft/ApplicationInsights-JS/blob/master/JavaScript/JavaScriptSDK/min/snippet.ps1 referred into JavaScriptSDK project file |
I see. I'm not much of an expert in PowerShell. I could copy the snippet.ps1 file and create one that generates a .js file but then most of the script will be the same and I'm not sure how you can do code reuse in PowerShell. Am I on the right track? |
Can you describe again why do we need this change? (I tried to follow microsoft/ApplicationInsights-aspnetcore#120 (comment) but it didn't really made sense to me) |
I want to add application insights as a separate JavaScript file, rather than inline script. This is to enable Content Security Policy (CSP) HTTP header compatibility (Inline scripts are not allowed without adding a hash or nonce attribute with specially computed values) for better security. According to the link posted by @SergeyKanzhelev, this also helped the Glimpse team achieve better performance. To achieve this I want to use the gulp-replace plugin to take the instrumentation key from the configuration file and insert it into the application insights JavaScript file in my ASP.NET 5 project template. I could grab a copy of the file but I would have to update it myself when Microsoft changes it. It would be nice if the file came straight from a NuGet package which can be updated. It would be even better if Microsoft released a Bower package for application insights explicitly for this purpose. @SergeyKanzhelev @MaxShehovtsov, what is Microsoft's appetite for this? Especially as Gulp and Bower are where ASP.NET 5 is headed. |
So once again, why prefix.html from nuget doesn't work? |
I need a separate .js file. I could use the .html file but then I would have to strip out the |
Strip out what? :) |
|
I have updated the ASP.NET MVC Boilerplate project template where you can see my use case in action, please see this issue for more information. |
I have spotted an applicationinsights-js bower package with the snippet.js file in it. I can now use that file in ASP.NET Core. This can be closed, unless someone finds this file useful in ASP.NET 4.6. |
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. |
It is a good idea to include the snippet as a script into NuGet package as discussed here:
microsoft/ApplicationInsights-aspnetcore#120 (comment)
The text was updated successfully, but these errors were encountered: