Skip to content

Commit

Permalink
Allow workshop instructions on different host to send Javascript mess…
Browse files Browse the repository at this point in the history
…ages to dashboard.
  • Loading branch information
GrahamDumpleton committed Dec 1, 2022
1 parent 7cb737c commit 84eb60f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ html.no-scrolling
data-ingress-protocol=config.ingress_protocol,
data-ingress-port-suffix=config.ingress_port_suffix,
data-terminal-layout=config.terminal_layout,
data-workshop-url=config.workshop_url,
data-workshop-ready=`${workshop_ready}`,
data-time-started=`${time_started}`,
data-page-hits=page_hits)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,17 @@ class Dashboard {

let result = false

let $body = $("body")
let workshop_url = $body.data("workshop-url")

if (workshop_url && workshop_url.match(/^https?:/)) {
let url = new URL(workshop_url)

if (origin == url.origin) {
result = true
}
}

$(".dashboard-iframe").each((index: number, element: HTMLElement) => {
let src = element.dataset["src"]

Expand Down

0 comments on commit 84eb60f

Please sign in to comment.