-
Notifications
You must be signed in to change notification settings - Fork 6
SCAL-116040 host-event current iframe url #8
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
Changes from 3 commits
d896261
a20cf8b
9e9c2c4
07da4e0
f2f25c9
071391f
a0b1920
ef44915
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2268,6 +2268,11 @@ export enum HostEvent { | |
* @hidden | ||
*/ | ||
Reload = 'reload', | ||
/** | ||
* Get current iframe src | ||
* @hidden | ||
|
||
*/ | ||
GetIframeSrc = 'getIframeSrc', | ||
/** | ||
* Display specific visualizations on a Liveboard. | ||
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ export const reload = (iFrame: HTMLIFrameElement) => { | |
}, 100); | ||
}; | ||
|
||
/** | ||
* Get the source URL of an iframe | ||
* @param iFrame | ||
* @returns The src URL of the iframe | ||
*/ | ||
export const getIframeSrc = (iframe: HTMLIFrameElement): string => { | ||
return iframe.src; | ||
}; | ||
|
||
/** | ||
* Post iframe message. | ||
* @param iFrame | ||
|
@@ -51,6 +60,9 @@ export function processTrigger( | |
reload(iFrame); | ||
return res(null); | ||
} | ||
if (messageType === HostEvent.GetIframeSrc) { | ||
|
||
return getIframeSrc(iFrame); | ||
|
||
} | ||
const channel = new MessageChannel(); | ||
channel.port1.onmessage = ({ data: responseData }) => { | ||
channel.port1.close(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.