fix: [webview] fix missing properties on events when contextIsolation: true (#26289)

This commit is contained in:
Jeremy Rose 2020-11-03 18:15:20 -08:00 committed by GitHub
parent c856b5fa53
commit 34156c424c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 24 deletions

View file

@ -39,7 +39,13 @@ const defineWebViewElement = (v8Util: NodeJS.V8UtilBinding, webViewImpl: typeof
constructor () {
super();
v8Util.setHiddenValue(this, 'internal', new WebViewImpl(this));
const internal = new WebViewImpl(this);
internal.dispatchEventInMainWorld = (eventName, props) => {
const event = new Event(eventName);
Object.assign(event, props);
return internal.webviewNode.dispatchEvent(event);
};
v8Util.setHiddenValue(this, 'internal', internal);
}
connectedCallback () {