Skip to content

Commit

Permalink
Update open system browser method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed Nov 18, 2024
1 parent ef70768 commit ccc13ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+
github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/flashlight/v7 v7.6.136 h1:SlscKLFtKtTk6DgZOhgqiuys+hhLOqVrQwZQIQtlDDs=
github.com/getlantern/flashlight/v7 v7.6.136 h1:t5+Z/rFQ7PZrD5tUH3a1EeYgDgUi1io+nioI602Qp9Q=
github.com/getlantern/flashlight/v7 v7.6.136/go.mod h1:PNDmAgH5Y3+Gi7Fnl05f1MW1joM+djK5ukKIaEjJMZA=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI=
Expand Down
12 changes: 10 additions & 2 deletions lib/core/app/app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,16 @@ Future<void> initializeWebViewEnvironment() async {
}

// openWithSystemBrowser opens a URL in the browser
Future<void> openWithSystemBrowser(String url) async =>
await InAppBrowser.openWithSystemBrowser(url: WebUri(url));
Future<void> openWithSystemBrowser(String url) async {
switch (Platform.operatingSystem) {
case 'linux':
final webview = await WebviewWindow.create();
webview.launch(url);
break;
default:
await InAppBrowser.openWithSystemBrowser(url: WebUri(url));
}
}

Future<void> openWebview(BuildContext context, String url,
[String? title]) async {
Expand Down

0 comments on commit ccc13ca

Please sign in to comment.