From d6e945fe23a52dc2499238c238d374aba23eb3b2 Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 28 Aug 2015 10:22:56 +0300 Subject: [PATCH] Chrome support complete --- ShareX.HelpersLib/Helpers/RegistryHelpers.cs | 2 +- ShareX/Forms/AboutForm.cs | 2 +- ShareX/Forms/ChromeForm.cs | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ShareX.HelpersLib/Helpers/RegistryHelpers.cs b/ShareX.HelpersLib/Helpers/RegistryHelpers.cs index 2ab75dcbc..b5f3e13e9 100644 --- a/ShareX.HelpersLib/Helpers/RegistryHelpers.cs +++ b/ShareX.HelpersLib/Helpers/RegistryHelpers.cs @@ -51,7 +51,7 @@ public static class RegistryHelpers private static readonly string ShellExtIcon = ApplicationPath + ",0"; private static readonly string ShellExtPath = ApplicationPath + " \"%1\""; - private static readonly string ChromeNativeMessagingHosts = @"SOFTWARE\Google\Chrome\NativeMessagingHosts\com.test.test"; + private static readonly string ChromeNativeMessagingHosts = @"SOFTWARE\Google\Chrome\NativeMessagingHosts\com.getsharex.sharex"; public static bool CheckStartWithWindows() { diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index 08815ec62..28e86e711 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -93,7 +93,7 @@ public AboutForm() System.Net.FtpClient: https://netftp.codeplex.com ResX Resource Manager: https://resxresourcemanager.codeplex.com AWSSDK: http://aws.amazon.com/sdk-for-net/ -BouncyCastle-PCL: https://github.com/onovotny/BouncyCastle-PCL +CLR Security: http://clrsecurity.codeplex.com Copyright (c) 2007-2015 ShareX Team", Resources.AboutForm_AboutForm_Contributors, Resources.AboutForm_AboutForm_Translators, Resources.AboutForm_AboutForm_External_libraries); } diff --git a/ShareX/Forms/ChromeForm.cs b/ShareX/Forms/ChromeForm.cs index ae8db5d2e..ee401d4cf 100644 --- a/ShareX/Forms/ChromeForm.cs +++ b/ShareX/Forms/ChromeForm.cs @@ -50,11 +50,11 @@ private void CreateChromeHostManifest(string filepath) { var manifest = new { - name = "com.test.test", + name = "com.getsharex.sharex", description = "ShareX", path = Program.ChromeHostPath, type = "stdio", - allowed_origins = new string[] { "" } + allowed_origins = new string[] { "chrome-extension://nlkoigbdolhchiicbonbihbphgamnaoc/" } }; string json = JsonConvert.SerializeObject(manifest, Formatting.Indented); @@ -69,6 +69,8 @@ private void btnRegister_Click(object sender, EventArgs e) CreateChromeHostManifest(Program.ChromeHostManifestPath); RegistryHelpers.RegisterChromeSupport(Program.ChromeHostManifestPath); + + MessageBox.Show("Chrome support enabled.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { @@ -86,6 +88,8 @@ private void btnUnregister_Click(object sender, EventArgs e) } RegistryHelpers.UnregisterChromeSupport(); + + MessageBox.Show("Chrome support disabled.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { @@ -95,7 +99,7 @@ private void btnUnregister_Click(object sender, EventArgs e) private void btnInstallExtension_Click(object sender, EventArgs e) { - URLHelpers.OpenURL(""); + URLHelpers.OpenURL("https://chrome.google.com/webstore/detail/sharex/nlkoigbdolhchiicbonbihbphgamnaoc"); } } } \ No newline at end of file