| | |
| | | <script> |
| | | const PORT = new URL(document.location.href).searchParams.get("port"); |
| | | |
| | | // ===== DhPostMessageDll In-Process Ping-Pong (kein localhost-Webserver noetig) ===== |
| | | // Antwort von C++ kommt hier an (erwartet "pong:ping"). |
| | | window.dhOnMessage = function (msg) { |
| | | if (msg == "pong:ping"); |
| | | document.title = "#success#CefSharp.PostMessage.Ping#"; |
| | | }; |
| | | function dhSendPing() { |
| | | try { |
| | | if (window.CefSharp && window.CefSharp.PostMessage) { |
| | | CefSharp.PostMessage("ping"); |
| | | } else { |
| | | document.title = "#failure#CefSharp.PostMessage nicht verfuegbar#"; |
| | | } |
| | | } catch (e) { |
| | | document.title = "#failure#CefSharp.PostMessage " + e.message + "#"; |
| | | } |
| | | } |
| | | window.addEventListener("load", dhSendPing); |
| | | |
| | | function pingTestLocal(callback) { |
| | | try { |
| | | var xhr = new XMLHttpRequest(); |