1 | import { Logger } from "../Logger";
|
2 | import { AuthCache } from "../cache/AuthCache";
|
3 | export declare class WindowUtils {
|
4 | /**
|
5 | * @hidden
|
6 | * Interval in milliseconds that we poll a window
|
7 | * @ignore
|
8 | */
|
9 | private static POLLING_INTERVAL_MS;
|
10 | /**
|
11 | * @hidden
|
12 | * Checks if the current page is running in an iframe.
|
13 | * @ignore
|
14 | */
|
15 | static isInIframe(): boolean;
|
16 | /**
|
17 | * @hidden
|
18 | * Check if the current page is running in a popup.
|
19 | * @ignore
|
20 | */
|
21 | static isInPopup(): boolean;
|
22 | /**
|
23 | * @hidden
|
24 | * @param prefix
|
25 | * @param scopes
|
26 | * @param authority
|
27 | */
|
28 | static generateFrameName(prefix: string, requestSignature: string): string;
|
29 | /**
|
30 | * @hidden
|
31 | * Polls an iframe until it loads a url with a hash
|
32 | * @ignore
|
33 | */
|
34 | static monitorIframeForHash(contentWindow: Window, timeout: number, urlNavigate: string, logger: Logger): Promise<string>;
|
35 | /**
|
36 | * @hidden
|
37 | * Polls a popup until it loads a url with a hash
|
38 | * @ignore
|
39 | */
|
40 | static monitorPopupForHash(contentWindow: Window, timeout: number, urlNavigate: string, logger: Logger): Promise<string>;
|
41 | /**
|
42 | * @hidden
|
43 | * Loads iframe with authorization endpoint URL
|
44 | * @ignore
|
45 | */
|
46 | static loadFrame(urlNavigate: string, frameName: string, timeoutMs: number, logger: Logger): Promise<HTMLIFrameElement>;
|
47 | /**
|
48 | * @hidden
|
49 | * Loads the iframe synchronously when the navigateTimeFrame is set to `0`
|
50 | * @param urlNavigate
|
51 | * @param frameName
|
52 | * @param logger
|
53 | */
|
54 | static loadFrameSync(urlNavigate: string, frameName: string, logger: Logger): HTMLIFrameElement;
|
55 | /**
|
56 | * @hidden
|
57 | * Adds the hidden iframe for silent token renewal.
|
58 | * @ignore
|
59 | */
|
60 | static addHiddenIFrame(iframeId: string, logger: Logger): HTMLIFrameElement;
|
61 | /**
|
62 | * @hidden
|
63 | * Removes a hidden iframe from the page.
|
64 | * @ignore
|
65 | */
|
66 | static removeHiddenIframe(iframe: HTMLIFrameElement): void;
|
67 | /**
|
68 | * @hidden
|
69 | * Find and return the iframe element with the given hash
|
70 | * @ignore
|
71 | */
|
72 | static getIframeWithHash(hash: string): HTMLIFrameElement;
|
73 | /**
|
74 | * @hidden
|
75 | * Returns an array of all the popups opened by MSAL
|
76 | * @ignore
|
77 | */
|
78 | static getPopups(): Array<Window>;
|
79 | /**
|
80 | * @hidden
|
81 | * Find and return the popup with the given hash
|
82 | * @ignore
|
83 | */
|
84 | static getPopUpWithHash(hash: string): Window;
|
85 | /**
|
86 | * @hidden
|
87 | * Add the popup to the known list of popups
|
88 | * @ignore
|
89 | */
|
90 | static trackPopup(popup: Window): void;
|
91 | /**
|
92 | * @hidden
|
93 | * Close all popups
|
94 | * @ignore
|
95 | */
|
96 | static closePopups(): void;
|
97 | /**
|
98 | * @ignore
|
99 | *
|
100 | * blocks any login/acquireToken calls to reload from within a hidden iframe (generated for silent calls)
|
101 | */
|
102 | static blockReloadInHiddenIframes(): void;
|
103 | /**
|
104 | *
|
105 | * @param cacheStorage
|
106 | */
|
107 | static checkIfBackButtonIsPressed(cacheStorage: AuthCache): void;
|
108 | /**
|
109 | * Removes url fragment from browser url
|
110 | */
|
111 | static clearUrlFragment(contentWindow: Window): void;
|
112 | }
|