Skip to content
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

New Snippet Setup pollutes the global namespace (window) #974

Closed
PeterOrneholm opened this issue Jul 19, 2019 · 3 comments · Fixed by #1258
Closed

New Snippet Setup pollutes the global namespace (window) #974

PeterOrneholm opened this issue Jul 19, 2019 · 3 comments · Fixed by #1258
Assignees
Milestone

Comments

@PeterOrneholm
Copy link

Using the new Snippet Setup introduces 5 global variables (on the window object). I can see the following being added to window.

  • aisdk
  • ainame
  • appInsightsSDK
  • appInsights
  • sdkInstance

Is this really necessary? Is there any usecase for when I should use / change these variables? I'd like a minimal global footprint (appInsights) and scope the rest to a local function. IF, they need to be global for some reason, a consistent prefix should be in place IMHO; sdkInstance feels very generic.

@MSNev MSNev self-assigned this Apr 21, 2020
MSNev pushed a commit that referenced this issue Apr 21, 2020
- New Snippet Setup pollutes the global namespace (window) #974
MSNev pushed a commit that referenced this issue Apr 22, 2020
- New Snippet Setup pollutes the global namespace (window) #974
MSNev pushed a commit that referenced this issue Apr 23, 2020
- New Snippet Setup pollutes the global namespace (window) #974
MSNev pushed a commit that referenced this issue Apr 29, 2020
- New Snippet Setup pollutes the global namespace (window) #974
MSNev added a commit that referenced this issue May 1, 2020
- New Snippet Setup pollutes the global namespace (window) #974
@MSNev
Copy link
Collaborator

MSNev commented May 1, 2020

An update snippet which address this issue has been checked in with #1258
This also updated the Readme, so it's now available on the readme page, will close this issue once we publish a full release so that the snippet.js and snippet.min.js are included in the NPM packages.
The snippet change is a lot larger because it's closing a gap that existed by sending an exception event to the server when it detects that the main SDK script could not be downloaded from the CDN, it also has some additional snippet only configuration options.

@MSNev MSNev added the fixed - waiting release PR Committed and waiting deployment label May 1, 2020
@MSNev MSNev added this to the 2.5.5 milestone Jun 2, 2020
@MSNev MSNev linked a pull request Jun 2, 2020 that will close this issue
@MSNev MSNev removed the fixed - waiting release PR Committed and waiting deployment label Jun 4, 2020
@MSNev
Copy link
Collaborator

MSNev commented Jun 4, 2020

Included in v 2.5.5 which is now fully deployed

@MSNev MSNev closed this as completed Jun 4, 2020
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants