Added InAppBrowser.onMainWindowWillClose event, Added WindowType.WINDOW for InAppWebViewSettings.windowType, fix #1738, Fixed InAppWebViewController.callAsyncJavaScript Android-issue when the last line of the functionBody parameter includes a code comment
This commit is contained in:
parent
63c2f7f65c
commit
4c72bbfc0e
2
LICENSE
2
LICENSE
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
## 6.0.0-rc.1
|
||||||
|
|
||||||
|
- Updated minimum platform interface and implementation versions
|
||||||
|
- Added `InAppBrowser.onMainWindowWillClose` event
|
||||||
|
- Added `WindowType.WINDOW` for `InAppWebViewSettings.windowType`
|
||||||
|
- Fixed "Cloudflare Turnstile failure" [#1738](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1738)
|
||||||
|
- Fixed `InAppWebViewController.callAsyncJavaScript` Android-issue when the last line of the `functionBody` parameter includes a code comment
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
- Default value of `InAppWebViewSettings.windowType` is `WindowType.WINDOW`
|
||||||
|
|
||||||
## 6.0.0-beta.32
|
## 6.0.0-beta.32
|
||||||
|
|
||||||
- Updated minimum platform interface and implementation versions
|
- Updated minimum platform interface and implementation versions
|
||||||
@ -17,7 +29,7 @@
|
|||||||
- Fixed "onClosed not considering back navigation or up button / close button in ChromeSafariBrowser when using noHistory: true" [#1882](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1882)
|
- Fixed "onClosed not considering back navigation or up button / close button in ChromeSafariBrowser when using noHistory: true" [#1882](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1882)
|
||||||
- Merged "Fixed error in InterceptAjaxRequestJS 'Failed to set responseType property'" [#1904](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1904) (thanks to [EArminjon](https://github.com/EArminjon))
|
- Merged "Fixed error in InterceptAjaxRequestJS 'Failed to set responseType property'" [#1904](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1904) (thanks to [EArminjon](https://github.com/EArminjon))
|
||||||
|
|
||||||
### BREAKING CHANGE
|
### BREAKING CHANGES
|
||||||
|
|
||||||
- Due to Flutter platform channels async nature, using `useShouldInterceptAjaxRequest: true` would break sync ajax requests, so that the `XMLHttpRequest.send()` will not wait for the response. To fix this issue, the default value of `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests` is `true`. To intercept also sync ajax requests, this value should be `false`.
|
- Due to Flutter platform channels async nature, using `useShouldInterceptAjaxRequest: true` would break sync ajax requests, so that the `XMLHttpRequest.send()` will not wait for the response. To fix this issue, the default value of `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests` is `true`. To intercept also sync ajax requests, this value should be `false`.
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -26,7 +26,9 @@ void onReceivedIcon() {
|
|||||||
pageLoaded.complete();
|
pageLoaded.complete();
|
||||||
},
|
},
|
||||||
onReceivedIcon: (controller, icon) {
|
onReceivedIcon: (controller, icon) {
|
||||||
onReceivedIconCompleter.complete(icon);
|
if (!onReceivedIconCompleter.isCompleted) {
|
||||||
|
onReceivedIconCompleter.complete(icon);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -61,6 +61,10 @@ class MyInAppBrowser extends InAppBrowser {
|
|||||||
print("\n\nOverride ${navigationAction.request.url}\n\n");
|
print("\n\nOverride ${navigationAction.request.url}\n\n");
|
||||||
return NavigationActionPolicy.ALLOW;
|
return NavigationActionPolicy.ALLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onMainWindowWillClose() {
|
||||||
|
close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InAppBrowserExampleScreen extends StatefulWidget {
|
class InAppBrowserExampleScreen extends StatefulWidget {
|
||||||
|
@ -116,7 +116,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
|||||||
InAppWebView(
|
InAppWebView(
|
||||||
key: webViewKey,
|
key: webViewKey,
|
||||||
initialUrlRequest:
|
initialUrlRequest:
|
||||||
URLRequest(url: WebUri('https://flutter.dev')),
|
URLRequest(url: WebUri('https://google.com')),
|
||||||
// initialUrlRequest:
|
// initialUrlRequest:
|
||||||
// URLRequest(url: WebUri(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
|
// URLRequest(url: WebUri(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
|
||||||
// initialFile: "assets/index.html",
|
// initialFile: "assets/index.html",
|
||||||
|
@ -538,4 +538,7 @@ class InAppBrowser implements PlatformInAppBrowserEvents {
|
|||||||
NavigationAction navigationAction) {
|
NavigationAction navigationAction) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onMainWindowWillClose() {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview
|
name: flutter_inappwebview
|
||||||
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
|
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
|
||||||
version: 6.0.0-beta.32
|
version: 6.0.0-rc.1
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
@ -18,11 +18,11 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_inappwebview_platform_interface: ^1.0.6
|
flutter_inappwebview_platform_interface: ^1.0.7
|
||||||
flutter_inappwebview_android: ^1.0.8
|
flutter_inappwebview_android: ^1.0.9
|
||||||
flutter_inappwebview_ios: ^1.0.9
|
flutter_inappwebview_ios: ^1.0.10
|
||||||
flutter_inappwebview_macos: ^1.0.7
|
flutter_inappwebview_macos: ^1.0.8
|
||||||
flutter_inappwebview_web: ^1.0.4
|
flutter_inappwebview_web: ^1.0.5
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
## 1.0.9
|
||||||
|
|
||||||
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.7`
|
||||||
|
- Fixed "Cloudflare Turnstile failure" [#1738](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1738)
|
||||||
|
- Fixed `InAppWebViewController.callAsyncJavaScript` issue when the last line of the `functionBody` parameter includes a code comment
|
||||||
|
|
||||||
## 1.0.8
|
## 1.0.8
|
||||||
|
|
||||||
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -15,6 +15,15 @@ public class ConsoleLogJS {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public static final String CONSOLE_LOG_JS_SOURCE = "(function(console) {" +
|
public static final String CONSOLE_LOG_JS_SOURCE = "(function(console) {" +
|
||||||
|
" function _buildMessage(args) {" +
|
||||||
|
" var message = '';" +
|
||||||
|
" for (var i in args) {" +
|
||||||
|
" try {" +
|
||||||
|
" message += message === '' ? args[i] : ' ' + args[i];" +
|
||||||
|
" } catch(ignored) {}" +
|
||||||
|
" }" +
|
||||||
|
" return message;" +
|
||||||
|
" }" +
|
||||||
" var oldLogs = {" +
|
" var oldLogs = {" +
|
||||||
" 'log': console.log," +
|
" 'log': console.log," +
|
||||||
" 'debug': console.debug," +
|
" 'debug': console.debug," +
|
||||||
@ -25,16 +34,7 @@ public class ConsoleLogJS {
|
|||||||
" for (var k in oldLogs) {" +
|
" for (var k in oldLogs) {" +
|
||||||
" (function(oldLog) {" +
|
" (function(oldLog) {" +
|
||||||
" console[oldLog] = function() {" +
|
" console[oldLog] = function() {" +
|
||||||
" var message = '';" +
|
" oldLogs[oldLog].call(console, _buildMessage(arguments));" +
|
||||||
" for (var i in arguments) {" +
|
|
||||||
" if (message == '') {" +
|
|
||||||
" message += arguments[i];" +
|
|
||||||
" }" +
|
|
||||||
" else {" +
|
|
||||||
" message += ' ' + arguments[i];" +
|
|
||||||
" }" +
|
|
||||||
" }" +
|
|
||||||
" oldLogs[oldLog].call(console, message);" +
|
|
||||||
" }" +
|
" }" +
|
||||||
" })(k);" +
|
" })(k);" +
|
||||||
" }" +
|
" }" +
|
||||||
|
@ -18,7 +18,7 @@ public class PluginScriptsUtil {
|
|||||||
|
|
||||||
public static final String CALL_ASYNC_JAVA_SCRIPT_WRAPPER_JS_SOURCE = "(function(obj) {" +
|
public static final String CALL_ASYNC_JAVA_SCRIPT_WRAPPER_JS_SOURCE = "(function(obj) {" +
|
||||||
" (async function(" + VAR_FUNCTION_ARGUMENT_NAMES + ") {" +
|
" (async function(" + VAR_FUNCTION_ARGUMENT_NAMES + ") {" +
|
||||||
" " + VAR_FUNCTION_BODY +
|
" \n" + VAR_FUNCTION_BODY + "\n" +
|
||||||
" })(" + VAR_FUNCTION_ARGUMENT_VALUES + ").then(function(value) {" +
|
" })(" + VAR_FUNCTION_ARGUMENT_VALUES + ").then(function(value) {" +
|
||||||
" window." + JavaScriptBridgeJS.JAVASCRIPT_BRIDGE_NAME + ".callHandler('callAsyncJavaScript', {'value': value, 'error': null, 'resultUuid': '" + VAR_RESULT_UUID + "'});" +
|
" window." + JavaScriptBridgeJS.JAVASCRIPT_BRIDGE_NAME + ".callHandler('callAsyncJavaScript', {'value': value, 'error': null, 'resultUuid': '" + VAR_RESULT_UUID + "'});" +
|
||||||
" }).catch(function(error) {" +
|
" }).catch(function(error) {" +
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview_android
|
name: flutter_inappwebview_android
|
||||||
description: Android implementation of the flutter_inappwebview plugin.
|
description: Android implementation of the flutter_inappwebview plugin.
|
||||||
version: 1.0.8
|
version: 1.0.9
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_android
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_android
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
@ -18,7 +18,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_inappwebview_platform_interface: ^1.0.6
|
flutter_inappwebview_platform_interface: ^1.0.7
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 1.0.10
|
||||||
|
|
||||||
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.7`
|
||||||
|
|
||||||
## 1.0.9
|
## 1.0.9
|
||||||
|
|
||||||
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview_ios
|
name: flutter_inappwebview_ios
|
||||||
description: iOS implementation of the flutter_inappwebview plugin.
|
description: iOS implementation of the flutter_inappwebview plugin.
|
||||||
version: 1.0.9
|
version: 1.0.10
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
@ -18,7 +18,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_inappwebview_platform_interface: ^1.0.6
|
flutter_inappwebview_platform_interface: ^1.0.7
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 1.0.8
|
||||||
|
|
||||||
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.7`
|
||||||
|
- Implemented `InAppBrowser.onMainWindowWillClose` event
|
||||||
|
|
||||||
## 1.0.7
|
## 1.0.7
|
||||||
|
|
||||||
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
- Implemented `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests`
|
||||||
@ -29,7 +34,7 @@
|
|||||||
## 1.0.1
|
## 1.0.1
|
||||||
|
|
||||||
- Added `PlatformPrintJobController.onComplete` setter
|
- Added `PlatformPrintJobController.onComplete` setter
|
||||||
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.2`
|
||||||
|
|
||||||
## 1.0.0
|
## 1.0.0
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -122,6 +122,10 @@ class MacOSInAppBrowser extends PlatformInAppBrowser with ChannelController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "onMainWindowWillClose":
|
||||||
|
_debugLog(call.method, call.arguments);
|
||||||
|
eventHandler?.onMainWindowWillClose();
|
||||||
|
break;
|
||||||
case "onExit":
|
case "onExit":
|
||||||
_debugLog(call.method, call.arguments);
|
_debugLog(call.method, call.arguments);
|
||||||
_isOpened = false;
|
_isOpened = false;
|
||||||
|
@ -25,6 +25,11 @@ public class InAppBrowserChannelDelegate : ChannelDelegate {
|
|||||||
channel?.invokeMethod("onMenuItemClicked", arguments: arguments)
|
channel?.invokeMethod("onMenuItemClicked", arguments: arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onMainWindowWillClose() {
|
||||||
|
let arguments: [String: Any?] = [:]
|
||||||
|
channel?.invokeMethod("onMainWindowWillClose", arguments: arguments)
|
||||||
|
}
|
||||||
|
|
||||||
public func onExit() {
|
public func onExit() {
|
||||||
let arguments: [String: Any?] = [:]
|
let arguments: [String: Any?] = [:]
|
||||||
channel?.invokeMethod("onExit", arguments: arguments)
|
channel?.invokeMethod("onExit", arguments: arguments)
|
||||||
|
@ -86,8 +86,10 @@ public class InAppBrowserManager: ChannelDelegate {
|
|||||||
|
|
||||||
if #available(macOS 10.12, *), browserSettings.windowType == .tabbed {
|
if #available(macOS 10.12, *), browserSettings.windowType == .tabbed {
|
||||||
NSApplication.shared.mainWindow?.addTabbedWindow(window, ordered: .above)
|
NSApplication.shared.mainWindow?.addTabbedWindow(window, ordered: .above)
|
||||||
} else {
|
} else if browserSettings.windowType == .child {
|
||||||
NSApplication.shared.mainWindow?.addChildWindow(window, ordered: .above)
|
NSApplication.shared.mainWindow?.addChildWindow(window, ordered: .above)
|
||||||
|
} else {
|
||||||
|
window.windowController?.showWindow(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
if browserSettings.hidden {
|
if browserSettings.hidden {
|
||||||
|
@ -16,7 +16,7 @@ public class InAppBrowserSettings: ISettings<InAppBrowserWebViewController> {
|
|||||||
var hideUrlBar = false
|
var hideUrlBar = false
|
||||||
var hideProgressBar = false
|
var hideProgressBar = false
|
||||||
var toolbarTopFixedTitle: String?
|
var toolbarTopFixedTitle: String?
|
||||||
var windowType = InAppBrowserWindowType.child
|
var windowType = InAppBrowserWindowType.window
|
||||||
var windowAlphaValue = 1.0
|
var windowAlphaValue = 1.0
|
||||||
var _windowStyleMask: NSNumber?
|
var _windowStyleMask: NSNumber?
|
||||||
var windowStyleMask: NSWindow.StyleMask? {
|
var windowStyleMask: NSWindow.StyleMask? {
|
||||||
|
@ -62,7 +62,7 @@ public class InAppBrowserWindow : NSWindow, NSWindowDelegate, NSToolbarDelegate,
|
|||||||
delegate = self
|
delegate = self
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self,
|
NotificationCenter.default.addObserver(self,
|
||||||
selector: #selector(onMainWindowClose(_:)),
|
selector: #selector(onMainWindowWillClose(_:)),
|
||||||
name: NSWindow.willCloseNotification,
|
name: NSWindow.willCloseNotification,
|
||||||
object: NSApplication.shared.mainWindow)
|
object: NSApplication.shared.mainWindow)
|
||||||
|
|
||||||
@ -348,13 +348,17 @@ public class InAppBrowserWindow : NSWindow, NSWindowDelegate, NSToolbarDelegate,
|
|||||||
dispose()
|
dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func onMainWindowClose(_ notification: Notification) {
|
@objc func onMainWindowWillClose(_ notification: Notification) {
|
||||||
close()
|
if let webViewController = contentViewController as? InAppBrowserWebViewController {
|
||||||
|
webViewController.channelDelegate?.onMainWindowWillClose()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
delegate = nil
|
delegate = nil
|
||||||
|
NotificationCenter.default.removeObserver(self,
|
||||||
|
name: NSWindow.willCloseNotification,
|
||||||
|
object: NSApplication.shared.mainWindow)
|
||||||
if let webViewController = contentViewController as? InAppBrowserWebViewController {
|
if let webViewController = contentViewController as? InAppBrowserWebViewController {
|
||||||
webViewController.dispose()
|
webViewController.dispose()
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public enum InAppBrowserWindowType: String {
|
public enum InAppBrowserWindowType: String {
|
||||||
|
case window = "WINDOW"
|
||||||
case child = "CHILD"
|
case child = "CHILD"
|
||||||
case tabbed = "TABBED"
|
case tabbed = "TABBED"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview_macos
|
name: flutter_inappwebview_macos
|
||||||
description: macOS implementation of the flutter_inappwebview plugin.
|
description: macOS implementation of the flutter_inappwebview plugin.
|
||||||
version: 1.0.7
|
version: 1.0.8
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_macos
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_macos
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
@ -18,7 +18,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_inappwebview_platform_interface: ^1.0.6
|
flutter_inappwebview_platform_interface: ^1.0.7
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 1.0.7
|
||||||
|
|
||||||
|
- Added `InAppBrowser.onMainWindowWillClose` event
|
||||||
|
- Added `WindowType.WINDOW` for `InAppWebViewSettings.windowType`
|
||||||
|
|
||||||
## 1.0.6
|
## 1.0.6
|
||||||
|
|
||||||
- Added `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests` [#1905](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1905)
|
- Added `InAppWebViewSettings.interceptOnlyAsyncAjaxRequests` [#1905](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1905)
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -254,7 +254,7 @@ class InAppBrowserSettings_
|
|||||||
ModalTransitionStyle_? transitionStyle;
|
ModalTransitionStyle_? transitionStyle;
|
||||||
|
|
||||||
///How the browser window should be added to the main window.
|
///How the browser window should be added to the main window.
|
||||||
///The default value is [WindowType.CHILD].
|
///The default value is [WindowType.WINDOW].
|
||||||
///
|
///
|
||||||
///**Officially Supported Platforms/Implementations**:
|
///**Officially Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
@ -195,7 +195,7 @@ class InAppBrowserSettings
|
|||||||
WindowTitlebarSeparatorStyle? windowTitlebarSeparatorStyle;
|
WindowTitlebarSeparatorStyle? windowTitlebarSeparatorStyle;
|
||||||
|
|
||||||
///How the browser window should be added to the main window.
|
///How the browser window should be added to the main window.
|
||||||
///The default value is [WindowType.CHILD].
|
///The default value is [WindowType.WINDOW].
|
||||||
///
|
///
|
||||||
///**Officially Supported Platforms/Implementations**:
|
///**Officially Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
@ -497,6 +497,12 @@ abstract class PlatformInAppBrowserEvents {
|
|||||||
///- MacOS
|
///- MacOS
|
||||||
void onExit() {}
|
void onExit() {}
|
||||||
|
|
||||||
|
///Event fired when the main window is about to close.
|
||||||
|
///
|
||||||
|
///**Officially Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
void onMainWindowWillClose() {}
|
||||||
|
|
||||||
///Event fired when the [PlatformInAppBrowser] starts to load an [url].
|
///Event fired when the [PlatformInAppBrowser] starts to load an [url].
|
||||||
///
|
///
|
||||||
///**Officially Supported Platforms/Implementations**:
|
///**Officially Supported Platforms/Implementations**:
|
||||||
|
@ -74,7 +74,7 @@ class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
|
|||||||
}
|
}
|
||||||
this._started = true;
|
this._started = true;
|
||||||
|
|
||||||
var completer = Completer();
|
final completer = Completer();
|
||||||
|
|
||||||
runZonedGuarded(() {
|
runZonedGuarded(() {
|
||||||
HttpServer.bind('127.0.0.1', _port, shared: _shared).then((server) {
|
HttpServer.bind('127.0.0.1', _port, shared: _shared).then((server) {
|
||||||
@ -108,7 +108,7 @@ class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
|
|||||||
var contentType = ContentType('text', 'html', charset: 'utf-8');
|
var contentType = ContentType('text', 'html', charset: 'utf-8');
|
||||||
if (!request.requestedUri.path.endsWith('/') &&
|
if (!request.requestedUri.path.endsWith('/') &&
|
||||||
request.requestedUri.pathSegments.isNotEmpty) {
|
request.requestedUri.pathSegments.isNotEmpty) {
|
||||||
var mimeType = MimeTypeResolver.lookup(request.requestedUri.path);
|
final mimeType = MimeTypeResolver.lookup(request.requestedUri.path);
|
||||||
if (mimeType != null) {
|
if (mimeType != null) {
|
||||||
contentType = _getContentTypeFromMimeType(mimeType);
|
contentType = _getContentTypeFromMimeType(mimeType);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,10 @@ class WindowType_ {
|
|||||||
|
|
||||||
const WindowType_._internal(this._value);
|
const WindowType_._internal(this._value);
|
||||||
|
|
||||||
|
///Adds the new browser window as a separate new window from the main window.
|
||||||
|
@EnumSupportedPlatforms(platforms: [EnumMacOSPlatform(value: 'WINDOW')])
|
||||||
|
static const WINDOW = const WindowType_._internal('WINDOW');
|
||||||
|
|
||||||
///Adds the new browser window as a child window of the main window.
|
///Adds the new browser window as a child window of the main window.
|
||||||
@EnumSupportedPlatforms(platforms: [EnumMacOSPlatform(value: 'CHILD')])
|
@EnumSupportedPlatforms(platforms: [EnumMacOSPlatform(value: 'CHILD')])
|
||||||
static const CHILD = const WindowType_._internal('CHILD');
|
static const CHILD = const WindowType_._internal('CHILD');
|
||||||
|
@ -44,10 +44,25 @@ class WindowType {
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Adds the new browser window as a separate new window from the main window.
|
||||||
|
///
|
||||||
|
///**Officially Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
static final WINDOW = WindowType._internalMultiPlatform('WINDOW', () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
return 'WINDOW';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Set of all values of [WindowType].
|
///Set of all values of [WindowType].
|
||||||
static final Set<WindowType> values = [
|
static final Set<WindowType> values = [
|
||||||
WindowType.CHILD,
|
WindowType.CHILD,
|
||||||
WindowType.TABBED,
|
WindowType.TABBED,
|
||||||
|
WindowType.WINDOW,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [WindowType] instance from [String] value.
|
///Gets a possible [WindowType] instance from [String] value.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview_platform_interface
|
name: flutter_inappwebview_platform_interface
|
||||||
description: A common platform interface for the flutter_inappwebview plugin.
|
description: A common platform interface for the flutter_inappwebview plugin.
|
||||||
version: 1.0.6
|
version: 1.0.7
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.7`
|
||||||
|
|
||||||
## 1.0.4
|
## 1.0.4
|
||||||
|
|
||||||
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.6`
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.6`
|
||||||
- Updated `CookieManager` methods return value
|
- Updated `CookieManager` methods return value
|
||||||
|
|
||||||
## 1.0.3
|
## 1.0.3
|
||||||
@ -10,11 +14,11 @@
|
|||||||
|
|
||||||
## 1.0.2
|
## 1.0.2
|
||||||
|
|
||||||
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.5`
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.5`
|
||||||
|
|
||||||
## 1.0.1
|
## 1.0.1
|
||||||
|
|
||||||
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
|
- Updated `flutter_inappwebview_platform_interface` version dependency to `^1.0.2`
|
||||||
|
|
||||||
## 1.0.0
|
## 1.0.0
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2022 Lorenzo Pichilli
|
Copyright 2023 Lorenzo Pichilli
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappwebview_web
|
name: flutter_inappwebview_web
|
||||||
description: Web implementation of the flutter_inappwebview plugin.
|
description: Web implementation of the flutter_inappwebview plugin.
|
||||||
version: 1.0.4
|
version: 1.0.5
|
||||||
homepage: https://inappwebview.dev/
|
homepage: https://inappwebview.dev/
|
||||||
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_web
|
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_web
|
||||||
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
|
||||||
@ -21,7 +21,7 @@ dependencies:
|
|||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
js: ^0.6.4
|
js: ^0.6.4
|
||||||
flutter_inappwebview_platform_interface: ^1.0.6
|
flutter_inappwebview_platform_interface: ^1.0.7
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user