fix #1841
This commit is contained in:
parent
acb20fc10a
commit
b190d02925
|
@ -5,6 +5,7 @@
|
|||
- Added support for Android `WebViewFeature.isStartupFeatureSupported`, `WebViewFeature.STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS`, `WebViewFeature.STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX`, `WebViewFeature.WEB_MESSAGE_ARRAY_BUFFER`
|
||||
- Added `WebMessage.type` property
|
||||
- Fixed "iOS EXC_BAD_ACCESS crash on kill app with InAppWebView keyboard open" [#1837](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1837)
|
||||
- Fixed "Flutter Web - TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'. error" [#1841](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1841)
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
|
|
|
@ -139,18 +139,21 @@ window.flutter_inappwebview = {
|
|||
}
|
||||
|
||||
var initialTitle = iframe.contentDocument.title;
|
||||
var titleEl = iframe.contentDocument.querySelector('title');
|
||||
webView.documentTitle = initialTitle;
|
||||
window.flutter_inappwebview.nativeCommunication('onTitleChanged', viewId, [initialTitle]);
|
||||
new MutationObserver(function(mutations) {
|
||||
var title = mutations[0].target.innerText;
|
||||
if (title != webView.documentTitle) {
|
||||
webView.documentTitle = title;
|
||||
window.flutter_inappwebview.nativeCommunication('onTitleChanged', viewId, [title]);
|
||||
}
|
||||
}).observe(
|
||||
iframe.contentDocument.querySelector('title'),
|
||||
{ subtree: true, characterData: true, childList: true }
|
||||
);
|
||||
if (titleEl != null) {
|
||||
new MutationObserver(function(mutations) {
|
||||
var title = mutations[0].target.innerText;
|
||||
if (title != webView.documentTitle) {
|
||||
webView.documentTitle = title;
|
||||
window.flutter_inappwebview.nativeCommunication('onTitleChanged', viewId, [title]);
|
||||
}
|
||||
}).observe(
|
||||
titleEl,
|
||||
{ subtree: true, characterData: true, childList: true }
|
||||
);
|
||||
}
|
||||
|
||||
var oldPixelRatio = iframe.contentWindow.devicePixelRatio;
|
||||
iframe.contentWindow.addEventListener('resize', function (e) {
|
||||
|
|
Loading…
Reference in New Issue