提交 ecc1fd4b 编写于 作者: M Matt Bierner

Fix webiew sometimes blank on first load

Fixes #30464

Moves and gates setting the parition of the webview. Setting it in the current location seems to cause a race condition.
上级 31aba004
......@@ -98,6 +98,9 @@ export default class Webview {
private _options: WebviewOptions = {},
) {
this._webview = <any>document.createElement('webview');
if (!this._options.allowSvgs) {
this._webview.setAttribute('partition', `webview${Webview.index++}`);
}
this._webview.style.width = '100%';
this._webview.style.height = '100%';
......@@ -110,7 +113,6 @@ export default class Webview {
this._webview.setAttribute('disableguestresize', '');
this._webview.setAttribute('webpreferences', 'contextIsolation=yes');
this._webview.setAttribute('partition', `webview${Webview.index++}`);
this._webview.preload = require.toUrl('./webview-pre.js');
this._webview.src = require.toUrl('./webview.html');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册