Skip to content

Commit a5c7a3b

Browse files
committed
Windows fixes
1 parent 59aef2a commit a5c7a3b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/widgets/webviews/webview_full.dart

+6-2
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ class WebViewFullState extends State<WebViewFull> with WidgetsBindingObserver {
11781178
_terminalProvider.terminal = "Terminal";
11791179

11801180
// Userscripts initial load
1181-
if (Platform.isAndroid || (Platform.isIOS && widget.windowId == null) || Platform.isWindows) {
1181+
if (Platform.isAndroid || (Platform.isIOS && widget.windowId == null) || Platform.isWindows && widget.windowId == null) {
11821182
UnmodifiableListView<UserScript> handlersScriptsToAdd = _userScriptsProvider.getHandlerSources(
11831183
apiKey: _userProvider?.basic?.userApiKey ?? "",
11841184
);
@@ -1194,6 +1194,10 @@ class WebViewFullState extends State<WebViewFull> with WidgetsBindingObserver {
11941194
_terminalProvider.addInstruction(
11951195
"TORN PDA NOTE: iOS does not support user scripts injection in new windows (like this one), but only in "
11961196
"full webviews. If you are trying to run a script, close this tab and open a new one from scratch.");
1197+
} else if (Platform.isWindows && widget.windowId != null) {
1198+
_terminalProvider.addInstruction(
1199+
"TORN PDA NOTE: Windows does not support user scripts injection in new windows (like this one), but only in "
1200+
"full webviews. If you are trying to run a script, close this tab and open a new one from scratch.");
11971201
}
11981202

11991203
// Copy to clipboard from the log doesn't work so we use a handler from JS fired from Torn
@@ -1294,7 +1298,7 @@ class WebViewFullState extends State<WebViewFull> with WidgetsBindingObserver {
12941298
final lockedTabCancels = _lockedTabShouldCancelsNavigation(action.request.url);
12951299
if (lockedTabCancels) return NavigationActionPolicy.CANCEL;
12961300

1297-
if (Platform.isAndroid || (Platform.isIOS && widget.windowId == null) || Platform.isWindows) {
1301+
if (Platform.isAndroid || (Platform.isIOS && widget.windowId == null) || Platform.isWindows && widget.windowId == null) {
12981302
// Userscripts load before webpage begins loading
12991303
UnmodifiableListView<UserScript> handlersScriptsToAdd = _userScriptsProvider.getHandlerSources(
13001304
apiKey: _userProvider?.basic?.userApiKey ?? "",

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies:
5656
flex_color_picker: ^3.5.1
5757
flutter_displaymode: ^0.6.0
5858
flutter_font_icons: ^2.2.7
59-
flutter_inappwebview: 6.1.5
59+
flutter_inappwebview: 6.2.0-beta.2
6060
#flutter_inappwebview: any
6161
flutter_local_notifications: 19.0.0-dev.1
6262

0 commit comments

Comments
 (0)