-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Using iframe based webviews on desktop #83188
Comments
Hi I am an extension author This issue totally prevents some of my users to open the webview contributed by my extension.
Adding this line to the settings fixes the problem:
Do you recommend me to make my extension spontaneously write useExternalEndpoint to the user settings? My extension requires internet anyway so this seems a reasonable workaround. I can try to detect when the problem occurs, by setting up a watchdog in the extension, and making the webview content call |
@sguillia No. Your extension should never direct users to enable this setting. It is intentionally not documented and marked as |
@deepak1556 Just pushed an update to my branch the enables offline iframe based webviews (without requiring service workers): https://github.com/mjbvz/vscode/tree/iframe-webviews The bulk of the change is in mjbvz@9091ad7 While can't switch to iframe based webviews yet, this iteration I think we should try the following:
|
@mjbvz does that solution preserve todays isolation from And a second question: what is the purpose of |
Yup we are preserving that, the idea for desktop is quite similar to web but instead of subdomains we generate new uuids for each webview that will act as the origin and we map that to the webview id. For ex:
On the main process side, we pretty much just have to handle the path to load resource from based on the
|
Ah ok, I was not aware that having the UUID as part of the URL is sufficient, that is great 👍 |
…search For #83188 This will let us get more test coverage of iframe based webviews
…l PDF viewer gets focused every time it reloaded when iframe based webviews enabled. microsoft/vscode#83188
Today VS Code implements the webview api on desktops using electron's
<webview>
tag. We've run into some unexpected behavior with webviews and would prefer to move to a more standard web based approach, such as using iframesFor web, we already implement webviews using normal iframes. You can also enable experimental iframe based webviews in desktop VS Code by setting
"webview.experimental.useIframes": true
("webview.experimental.useExternalEndpoint": true
in older VS Code versions)Known blockers:
We probably want to use an electron custom-protocol to host the webview content itself. However we cannot register a service worker inside pages served up using a custom protocol: Cannot use service worker in html document served from custom protocol: The document is in an invalid state. electron/electron#20248
Find does not work for for iframe based webviews. There is no clear way to implement the find functionality for webviews without taking a dependency on a third party html search library
The text was updated successfully, but these errors were encountered: