fix: <webview> not working with Trusted Types (#27445)
This commit is contained in:
parent
949fd0728f
commit
4a5c5843c4
3 changed files with 22 additions and 4 deletions
|
@ -44,7 +44,9 @@ export class WebViewImpl {
|
|||
// Create internal iframe element.
|
||||
this.internalElement = this.createInternalElement();
|
||||
const shadowRoot = this.webviewNode.attachShadow({ mode: 'open' });
|
||||
shadowRoot.innerHTML = '<!DOCTYPE html><style type="text/css">:host { display: flex; }</style>';
|
||||
const style = shadowRoot.ownerDocument.createElement('style');
|
||||
style.textContent = ':host { display: flex; }';
|
||||
shadowRoot.appendChild(style);
|
||||
this.setupWebViewAttributes();
|
||||
this.viewInstanceId = getNextId();
|
||||
shadowRoot.appendChild(this.internalElement);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue