diff --git a/cmd/host/main.go b/cmd/host/main.go index f4168721..db6f4da7 100644 --- a/cmd/host/main.go +++ b/cmd/host/main.go @@ -46,7 +46,11 @@ var apiMap = map[string]func(params json.RawMessage) (data any, err error){ return false, nil }, "create": func(params json.RawMessage) (data any, err error) { - err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, string(params))) + var strParams string + if err = json.Unmarshal(params, &strParams); err != nil { + return + } + err = browser.OpenURL(fmt.Sprintf("%s:///create?params=%s", identifier, strParams)) return }, } diff --git a/ui/flutter/lib/app/modules/app/controllers/app_controller.dart b/ui/flutter/lib/app/modules/app/controllers/app_controller.dart index 6bbcf254..45baea01 100644 --- a/ui/flutter/lib/app/modules/app/controllers/app_controller.dart +++ b/ui/flutter/lib/app/modules/app/controllers/app_controller.dart @@ -337,7 +337,8 @@ class AppController extends GetxController with WindowListener, TrayListener { if (uri.path == "/create") { final params = uri.queryParameters["params"]; if (params?.isNotEmpty == true) { - final paramsJson = String.fromCharCodes(base64Decode(params!)); + final paramsJson = + String.fromCharCodes(base64Decode(base64.normalize(params!))); Get.rootDelegate.offAndToNamed(Routes.REDIRECT, arguments: RedirectArgs(Routes.CREATE, arguments: diff --git a/ui/flutter/lib/util/browser_extension_host/entry/browser_extension_host_native.dart b/ui/flutter/lib/util/browser_extension_host/entry/browser_extension_host_native.dart index 828e5404..ce1c27c5 100644 --- a/ui/flutter/lib/util/browser_extension_host/entry/browser_extension_host_native.dart +++ b/ui/flutter/lib/util/browser_extension_host/entry/browser_extension_host_native.dart @@ -36,7 +36,12 @@ Future doInstallHost() async { // Check if host binary is not installed if (!await File(hostPath).exists()) { final hostData = await getHostAssetData(); - await File(hostPath).writeAsBytes(hostData); + final file = File(hostPath); + await file.writeAsBytes(hostData); + // Add execute permission + if (!Platform.isWindows) { + await Process.run('chmod', ['+x', hostPath]); + } return; } // Check if host binary is outdated