-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What does it mean to Photino that window.external is deprecated by browsers? #124
Comments
I doubt it will mean much since the window.external object is being initialized/created by Photino itself. In the end it is a wrapper around window.chrome.webview.postMessage (Windows/Webview2), window.webkit.messageHandlers.Photinointerop (a custom handler, Linux/WebkitGTK) and window.webkit.messageHandlers.photinointerop (Mac/Webkit). see for example (windows) https://github.com/tryphotino/photino.Native/blob/24be1c50d3dcb4c92c33a0081160ecc10959553c/Photino.Native/Photino.Windows.cpp#L751
The initialization is a raw declaration of a new object, regardless if 'window.external' already existed, which javascript allows (try overwriting console.log with a new function sometime). So the deprecation of a mechanism which wasn't used doesn't affect the project I think. |
That is excellent info and great news. thanks for pointing out that this is actually a wrapper around those other (supported) methods. |
Closed since window.external is a Photino wrapper around the proper code. |
Going forward, we may need to implement this on a platform-by-platform basis. WebKitGTK (Linux): maybe this? https://webkitgtk.org/reference/webkit2gtk/stable/method.WebView.run_javascript.html WebKit (Mac): maybe this? https://stackoverflow.com/questions/62035494/how-to-call-postmessage-in-wkwebview-to-js For now, to get around TypeScript compile errors you can do a work-around like (myObject as any).myMethod() or myObject.myMethod?.() |
That would work. I played around a bit and discovered We should look into the options you talked about, but I think there will still be an issue with TypeScript. This may not be a problem that requires us to make changes. I'm not sure. |
Just discovered that window.external is being deprecated by browsers.
You can see the deprecation warning on the MDN at: https://developer.mozilla.org/en-US/docs/Web/API/Window/external
What will this mean for Photino.NET moving forward?
The text was updated successfully, but these errors were encountered: