From 45c3652bc5151c34eae61337de638685d4d4a67c Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Thu, 13 Oct 2022 21:18:07 +0200 Subject: [PATCH] =?UTF-8?q?merged=20fix(ios):=20invoke=20onBrowserCreated?= =?UTF-8?q?=20when=20viewDidLoad=20is=20called=20with=20win=E2=80=A6,=20up?= =?UTF-8?q?dated=20webview=20debug=20settings,=20updated=20debug=20logging?= =?UTF-8?q?=20message=20with=20platform=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift | 1 + lib/src/chrome_safari_browser/chrome_safari_browser.dart | 2 +- lib/src/find_interaction/find_interaction_controller.dart | 3 ++- lib/src/in_app_browser/in_app_browser.dart | 3 ++- lib/src/in_app_webview/in_app_webview_controller.dart | 3 ++- lib/src/in_app_webview/webview.dart | 1 + lib/src/pull_to_refresh/pull_to_refresh_controller.dart | 3 ++- .../web_authentication_session/web_authenticate_session.dart | 2 +- 9 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da42ceac..06f78615 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ - Removed `URLProtectionSpace.iosIsProxy` property - `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` -## 5.4.5 +## 5.5.0 - Added Android direct camera capture feature - Fixed missing `PullToRefreshController.isRefreshing` iOS implementation @@ -46,6 +46,7 @@ - Merged "Catch and ignore utf8 format exception in getFavicons()" [#1302](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1302) (thanks to [Doflatango](https://github.com/Doflatango)) - Merged "Disable exporting activity definitions for Android" [#1313](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1313) (thanks to [daanporon](https://github.com/daanporon)) - Merged "Add directoryIndex and documentRoot to InAppLocalhostServer option" [#1319](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1319) (thanks to [fa0311](https://github.com/fa0311)) +- Merged "fix(ios): invoke onBrowserCreated when viewDidLoad is called with win…" [#1344](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1344) (thanks to [perffecto](https://github.com/perffecto)) ## 5.4.4+3 diff --git a/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift index e79a62ec..2abbc95d 100755 --- a/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -128,6 +128,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega if let wId = windowId, let webViewTransport = InAppWebView.windowWebViews[wId] { webView?.load(webViewTransport.request) + channelDelegate?.onBrowserCreated() } else { if #available(iOS 11.0, *) { if let contentBlockers = webView?.settings?.contentBlockers, contentBlockers.count > 0 { diff --git a/lib/src/chrome_safari_browser/chrome_safari_browser.dart b/lib/src/chrome_safari_browser/chrome_safari_browser.dart index d02a7e22..0789651a 100755 --- a/lib/src/chrome_safari_browser/chrome_safari_browser.dart +++ b/lib/src/chrome_safari_browser/chrome_safari_browser.dart @@ -80,7 +80,7 @@ class ChromeSafariBrowser { } var maxLogMessageLength = ChromeSafariBrowser.debugLoggingSettings.maxLogMessageLength; - String message = "ChromeSafariBrowser ID " + + String message = "(${defaultTargetPlatform.name}) ChromeSafariBrowser ID " + id + " calling \"" + method.toString() + diff --git a/lib/src/find_interaction/find_interaction_controller.dart b/lib/src/find_interaction/find_interaction_controller.dart index b7f79ffe..875fa2b7 100644 --- a/lib/src/find_interaction/find_interaction_controller.dart +++ b/lib/src/find_interaction/find_interaction_controller.dart @@ -1,5 +1,6 @@ import 'dart:developer' as developer; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import '../in_app_webview/in_app_webview_settings.dart'; import '../debug_logging_settings.dart'; @@ -58,7 +59,7 @@ class FindInteractionController { } var maxLogMessageLength = FindInteractionController.debugLoggingSettings.maxLogMessageLength; - String message = "FindInteractionController " + + String message = "(${defaultTargetPlatform.name}) FindInteractionController " + " calling \"" + method.toString() + "\" using " + diff --git a/lib/src/in_app_browser/in_app_browser.dart b/lib/src/in_app_browser/in_app_browser.dart index f97fc7fa..8084ed82 100755 --- a/lib/src/in_app_browser/in_app_browser.dart +++ b/lib/src/in_app_browser/in_app_browser.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer' as developer; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import '../context_menu.dart'; @@ -108,7 +109,7 @@ class InAppBrowser { } var maxLogMessageLength = InAppBrowser.debugLoggingSettings.maxLogMessageLength; - String message = "InAppBrowser ID " + + String message = "(${defaultTargetPlatform.name}) InAppBrowser ID " + id + " calling \"" + method.toString() + diff --git a/lib/src/in_app_webview/in_app_webview_controller.dart b/lib/src/in_app_webview/in_app_webview_controller.dart index 9fcf9f25..78b6d41b 100644 --- a/lib/src/in_app_webview/in_app_webview_controller.dart +++ b/lib/src/in_app_webview/in_app_webview_controller.dart @@ -118,7 +118,8 @@ class InAppWebViewController { var maxLogMessageLength = WebView.debugLoggingSettings.maxLogMessageLength; String viewId = (getViewId() ?? _inAppBrowser?.id).toString(); - String message = (_inAppBrowser == null ? "WebView" : "InAppBrowser") + + String message = "(${defaultTargetPlatform.name}) " + + (_inAppBrowser == null ? "WebView" : "InAppBrowser") + " ID " + viewId + " calling \"" + diff --git a/lib/src/in_app_webview/webview.dart b/lib/src/in_app_webview/webview.dart index bbcba4d4..9d897f65 100644 --- a/lib/src/in_app_webview/webview.dart +++ b/lib/src/in_app_webview/webview.dart @@ -21,6 +21,7 @@ abstract class WebView { ///Debug settings used by [InAppWebView], [HeadlessInAppWebView] and [InAppBrowser]. ///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events. static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings( + maxLogMessageLength: 1000, excludeFilter: [ RegExp(r"onScrollChanged"), RegExp(r"onOverScrolled"), diff --git a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart index 85b529ca..3221a23e 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart @@ -1,5 +1,6 @@ import 'dart:developer' as developer; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import '../in_app_webview/webview.dart'; import '../in_app_browser/in_app_browser.dart'; @@ -65,7 +66,7 @@ class PullToRefreshController { } var maxLogMessageLength = PullToRefreshController.debugLoggingSettings.maxLogMessageLength; - String message = "PullToRefreshController " + + String message = "(${defaultTargetPlatform.name}) PullToRefreshController " + " calling \"" + method.toString() + "\" using " + diff --git a/lib/src/web_authentication_session/web_authenticate_session.dart b/lib/src/web_authentication_session/web_authenticate_session.dart index cdfbb382..c48d03e2 100755 --- a/lib/src/web_authentication_session/web_authenticate_session.dart +++ b/lib/src/web_authentication_session/web_authenticate_session.dart @@ -120,7 +120,7 @@ class WebAuthenticationSession implements Disposable { } var maxLogMessageLength = WebAuthenticationSession.debugLoggingSettings.maxLogMessageLength; - String message = "WebAuthenticationSession ID " + + String message = "(${defaultTargetPlatform.name}) WebAuthenticationSession ID " + id + " calling \"" + method.toString() +