Chrome support complete

This commit is contained in:
Jaex 2015-08-28 10:22:56 +03:00
parent d0e57efdfa
commit d6e945fe23
3 changed files with 9 additions and 5 deletions

View file

@ -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()
{

View file

@ -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);
}

View file

@ -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");
}
}
}