Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[desktop_webview_window] Webview doesn't work on macOS #337

Open
treeplate opened this issue May 10, 2024 · 2 comments
Open

[desktop_webview_window] Webview doesn't work on macOS #337

treeplate opened this issue May 10, 2024 · 2 comments

Comments

@treeplate
Copy link

When I try to launch a webview window, it instead launches a copy of the main app, and when that tries to launch a webview window, it crashes.

Reproduce Steps

lib/main.dart:

import 'package:flutter/material.dart';
import 'package:desktop_webview_window/desktop_webview_window.dart';

void main(List<String> arguments) {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: OutlinedButton(
          child: FlutterLogo(),
          onPressed: () {
            WebviewWindow.create().then((webview) {
              webview.launch('example.com');
            });
          },
        ),
      ),
    ),
  );
}

Run the app, press the button. Then, press the button on the new window that launched.

what it looks like
window on window

Version (please complete the following information):

  • Flutter Version: 3.22.0-31.0.pre.3
  • OS: macOS 14.4.1
  • plugin: desktop_webview_window
@rxy20
Copy link

rxy20 commented May 15, 2024

I also ran into the same problem, my solution is to add non-HTTP support, I wonder if it will work for you? You can have a try.

Add the following to the Info.plist file:

<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>

@treeplate
Copy link
Author

I also ran into the same problem, my solution is to add non-HTTP support, I wonder if it will work for you? You can have a try.

Add the following to the Info.plist file:

<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>

error: "Runner" has entitlements that require signing with a development certificate. Enable development signing in the Signing & Capabilities editor. (in target 'Runner' from project 'Runner')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants