Do not initShellComm in frame

This commit is contained in:
Vladimir Borisov 2021-07-27 10:55:12 +03:00
parent fd970689ba
commit cc906ddd2b
No known key found for this signature in database
GPG key ID: F9A584BE4FCB6603

View file

@ -94,9 +94,11 @@ impl PartialUi for WebView {
webview
.add_script_to_execute_on_document_created(
r##"
try{if(window.self === window.top) {
window.qt={webChannelTransport:{send:window.chrome.webview.postMessage}};
window.chrome.webview.addEventListener('message',ev=>window.qt.webChannelTransport.onmessage(ev));
window.onload=()=>{try{initShellComm();}catch(e){window.chrome.webview.postMessage('{"id":1,"args":["app-error","'+e.message+'"]}')}};
}}catch(e){}
"##,
|_| Ok(()),
)