Skip to content

Commit 864e6b0

Browse files
author
Levi
committed
fix
1 parent 0b1d6ca commit 864e6b0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

cmd/host/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ var apiMap = map[string]func(params json.RawMessage) (data any, err error){
4646
return false, nil
4747
},
4848
"create": func(params json.RawMessage) (data any, err error) {
49-
err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, string(params)))
49+
var strParams string
50+
if err = json.Unmarshal(params, &strParams); err != nil {
51+
return
52+
}
53+
err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, strParams))
5054
return
5155
},
5256
}

ui/flutter/lib/app/modules/app/controllers/app_controller.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ class AppController extends GetxController with WindowListener, TrayListener {
337337
if (uri.path == "/create") {
338338
final params = uri.queryParameters["params"];
339339
if (params?.isNotEmpty == true) {
340-
final paramsJson = String.fromCharCodes(base64Decode(params!));
340+
final paramsJson =
341+
String.fromCharCodes(base64Decode(base64.normalize(params!)));
341342
Get.rootDelegate.offAndToNamed(Routes.REDIRECT,
342343
arguments: RedirectArgs(Routes.CREATE,
343344
arguments:

ui/flutter/lib/util/browser_extension_host/entry/browser_extension_host_native.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ Future<void> doInstallHost() async {
3636
// Check if host binary is not installed
3737
if (!await File(hostPath).exists()) {
3838
final hostData = await getHostAssetData();
39-
await File(hostPath).writeAsBytes(hostData);
39+
final file = File(hostPath);
40+
await file.writeAsBytes(hostData);
41+
// Add execute permission
42+
if (!Platform.isWindows) {
43+
await Process.run('chmod', ['+x', hostPath]);
44+
}
4045
return;
4146
}
4247
// Check if host binary is outdated

0 commit comments

Comments
 (0)