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

Validation tweak on stage details graphs/stats tab #10190

Merged
merged 1 commit into from Feb 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Validate origin of messages posted to the stats/graphs window from it…
…s sub-iframe
  • Loading branch information
chadlwilson committed Feb 13, 2022
commit a256d05de1445e6c77843f098581fc6a66fe4477
Expand Up @@ -27,14 +27,16 @@
<div id="stage_stats">
<div class="stats">
<div id="chart_details_container">
<iframe sandbox="allow-scripts" width="100%" height="400px" src="<%= stage_detail_tab_stats_iframe_path() %>"></iframe>
<iframe id="chart_details_iframe" sandbox="allow-scripts" width="100%" height="400px" src="<%= stage_detail_tab_stats_iframe_path() %>"></iframe>
</div>
</div>
</div>
<script>
window.addEventListener("message", function(event) {
var data = JSON.parse(event.data);
window.location.href = data.openLink;
if (event.source === document.getElementById("chart_details_iframe").contentWindow) {
var data = JSON.parse(event.data);
window.location.href = data.openLink;
}
}, false);
</script>
<% when 'stage_config' %>
Expand Down