New injectScript and redirect command for UiServer
This commit is contained in:
parent
7cbbc33319
commit
233e161327
1 changed files with 7 additions and 0 deletions
|
@ -92,8 +92,15 @@ class Wrapper
|
|||
else if cmd == "updating" # Close connection
|
||||
@ws.ws.close()
|
||||
@ws.onCloseWebsocket(null, 4000)
|
||||
else if cmd == "redirect"
|
||||
window.top.location = message.params
|
||||
else if cmd == "injectHtml"
|
||||
$("body").append(message.params)
|
||||
else if cmd == "injectScript"
|
||||
script_tag = $("<script>")
|
||||
script_tag.attr("nonce", @script_nonce)
|
||||
script_tag.html(message.params)
|
||||
document.head.appendChild(script_tag[0])
|
||||
else
|
||||
@sendInner message # Pass message to inner frame
|
||||
|
||||
|
|
Loading…
Reference in a new issue