Skip to content

Commit 72f5cc4

Browse files
authored
Add classname to silent token renewal iframe HTML Element (#6960)
1 parent 9382838 commit 72f5cc4

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add classname to silent token renewal iframe HTML element #6960",
4+
"packageName": "@azure/msal-browser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-browser/src/interaction_handler/SilentHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export class SilentHandler extends InteractionHandler {
148148
private createHiddenIframe(): HTMLIFrameElement {
149149
const authFrame = document.createElement("iframe");
150150

151+
authFrame.className = "msalSilentIframe";
151152
authFrame.style.visibility = "hidden";
152153
authFrame.style.position = "absolute";
153154
authFrame.style.width = authFrame.style.height = "0";

lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,14 @@ describe("SilentHandler.ts Unit Tests", () => {
262262
}, 500);
263263
});
264264
});
265+
266+
describe("createHiddenIframe()", () => {
267+
it("creates iframe HTML element with classname and src properties", () => {
268+
const silentHandler = new SilentHandler(authCodeModule, browserStorage, defaultTokenRequest, browserRequestLogger, { navigateFrameWait: DEFAULT_IFRAME_TIMEOUT_MS, pollIntervalMilliseconds: DEFAULT_POLL_INTERVAL_MS }, performanceClient);
269+
// @ts-ignore
270+
const authFrame = silentHandler.createHiddenIframe();
271+
expect(authFrame instanceof HTMLIFrameElement).toBe(true);
272+
expect(authFrame.className).toEqual("msalSilentIframe");
273+
});
274+
})
265275
});

0 commit comments

Comments
 (0)