Skip to content

Commit

Permalink
local test pass (#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuniu-ms committed Jun 10, 2024
1 parent 46ce907 commit 65a6e61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AISKU/src/Init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ try {
if (typeof window !== strUndefined) {
var _window = window;
aiName = _window["appInsightsSDK"] || "appInsights";
if (document.currentScript) {
aiName = document.currentScript.getAttribute("data-ai-name") || aiName;
}
if (typeof JSON !== strUndefined) {
// get snippet or initialize to an empty object

Expand Down
1 change: 1 addition & 0 deletions tools/applicationinsights-web-snippet/src/snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ declare var cfg:ISnippetConfig;
const _createScript = (src: string) => {
let scriptElement : HTMLElement = doc.createElement(scriptText);
(scriptElement as any)["src"] = src;
(scriptElement as any).setAttribute("data-ai-name", aiName);
// Allocate Cross origin only if defined and available
let crossOrigin = cfg[strCrossOrigin];
if ((crossOrigin || crossOrigin === "") && scriptElement[strCrossOrigin] != strUndefined) {
Expand Down

0 comments on commit 65a6e61

Please sign in to comment.