You can’t. That layout is delivered to the browser when it first connects. The idea is that the page needs to be there if the browser can’t communicate with the app. When that happens this page is displayed.
I concur we need a feature request to alter some of the parameters that are initially sent. Alternatively it would be nice if there was a hard coded URL if the app goes down they are redirected to that URL.
You could just rewrite the html using ExecuteJavascript. And unlike most of the app, these elements always have the same ids (XojoDisconnectCaption, XojoDisconnectIcon). Something like this in the Session.Open event:
Me.ExecuteJavascript("document.getElementById('XojoDisconnectCaption').innerHTML='App has gone bye bye!';")
Me.ExecuteJavascript("document.getElementById('XojoDisconnectIcon').innerHTML=""<img src='/path/to/image.jpg' width='133' height='134'>"";")
[quote=160183:@Jay Madren]You could just rewrite the html using ExecuteJavascript. And unlike most of the app, these elements always have the same ids (XojoDisconnectCaption, XojoDisconnectIcon). Something like this in the Session.Open event:
Me.ExecuteJavascript("document.getElementById('XojoDisconnectCaption').innerHTML='App has gone bye bye!';")
Me.ExecuteJavascript("document.getElementById('XojoDisconnectIcon').innerHTML=""<img src='/path/to/image.jpg' width='133' height='134'>"";")
[/quote]
The message can be changed in the IDE, but your method allows to place a custom icon. This is brilliant, Jay. Thank you so much
True, but that’s all you can do is change the text. Using my method you can change its styling or pretty much anything else, e.g.
Me.ExecuteJavascript("document.getElementById('XojoDisconnectCaption').innerHTML='<span style=color:red>App has gone <b>bye bye</b>!</span>';")
Of course, you could also override the style in a CSS block that you add to the app HTMLHeader, but this way keeps everything in one place for easier maintenance.
[quote=160227:@Jay Madren]@Michel Bujardet The message can be changed in the IDE
True, but that’s all you can do is change the text. Using my method you can change its styling or pretty much anything else, e.g.[/quote]
Right. I just realized it a few minutes ago, while implementing it.
Your method allowed me to display the reload symbol (Clockwise Open Circle Arrow) ? :
[quote=160183:@Jay Madren]You could just rewrite the html using ExecuteJavascript. And unlike most of the app, these elements always have the same ids (XojoDisconnectCaption, XojoDisconnectIcon). Something like this in the Session.Open event:
Me.ExecuteJavascript("document.getElementById('XojoDisconnectCaption').innerHTML='App has gone bye bye!';")
Me.ExecuteJavascript("document.getElementById('XojoDisconnectIcon').innerHTML=""<img src='/path/to/image.jpg' width='133' height='134'>"";")
[/quote]
That method worked great in Safari, but not in Chrome.
Just tried that code and it worked just as well on Safari and Firefox too. Chrome still resorted to the hazard icon. Chrome must be fighting the update…
Just tried that code and it worked just as well on Safari and Firefox too. Chrome still resorted to the hazard icon. Chrome must be fighting the update…[/quote]
I tested it here on Chrome before posting. to make sure it works. Strange.
Could you look in Developer Tools (View menu) the exact content of XojoDisconnectIcon ? It is within XojoOverlay/XojoDisconnect.
If you could copy it and post here, that would help debug the issue.
I could not find a way for that, but here is a way to entirely replace the disconnect page by whatever HTML you want .
Add a constant named bye containing the HTML code of the page you want to display
So, I just changed the url to a base64 string like “data:image/png;base64,iVBORw0KGgoAAAANSU…MYk5QeqFAEM2wbG3i” and it works in Chrome, Safari and Firefox!
[quote=227606:@Hal Gumbert]The tags looked like this even when changed using the javascript code…
[code]
Xanadu has gone offline.
[/code][/quote]
Here is a possible improvement to your method. This uses the king.png picture that was dragged into the project :
[code] dim pic as picture = king
dim mb as memoryblock = pic.GetData(Picture.FormatPNG)
dim js as string
js = js + “var pic =document.getElementById(‘XojoDisconnectIcon’).getElementsByTagName(‘img’); "
js = js + “pic[0].src='data:image/png;base64,”+encodebase64(mb.stringvalue(0,mb.Size),0)+”’;"