mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12:00
Chrome support complete
This commit is contained in:
parent
d0e57efdfa
commit
d6e945fe23
|
@ -51,7 +51,7 @@ public static class RegistryHelpers
|
||||||
private static readonly string ShellExtIcon = ApplicationPath + ",0";
|
private static readonly string ShellExtIcon = ApplicationPath + ",0";
|
||||||
private static readonly string ShellExtPath = ApplicationPath + " \"%1\"";
|
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()
|
public static bool CheckStartWithWindows()
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,7 +93,7 @@ public AboutForm()
|
||||||
System.Net.FtpClient: https://netftp.codeplex.com
|
System.Net.FtpClient: https://netftp.codeplex.com
|
||||||
ResX Resource Manager: https://resxresourcemanager.codeplex.com
|
ResX Resource Manager: https://resxresourcemanager.codeplex.com
|
||||||
AWSSDK: http://aws.amazon.com/sdk-for-net/
|
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);
|
Copyright (c) 2007-2015 ShareX Team", Resources.AboutForm_AboutForm_Contributors, Resources.AboutForm_AboutForm_Translators, Resources.AboutForm_AboutForm_External_libraries);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,11 +50,11 @@ private void CreateChromeHostManifest(string filepath)
|
||||||
{
|
{
|
||||||
var manifest = new
|
var manifest = new
|
||||||
{
|
{
|
||||||
name = "com.test.test",
|
name = "com.getsharex.sharex",
|
||||||
description = "ShareX",
|
description = "ShareX",
|
||||||
path = Program.ChromeHostPath,
|
path = Program.ChromeHostPath,
|
||||||
type = "stdio",
|
type = "stdio",
|
||||||
allowed_origins = new string[] { "" }
|
allowed_origins = new string[] { "chrome-extension://nlkoigbdolhchiicbonbihbphgamnaoc/" }
|
||||||
};
|
};
|
||||||
|
|
||||||
string json = JsonConvert.SerializeObject(manifest, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(manifest, Formatting.Indented);
|
||||||
|
@ -69,6 +69,8 @@ private void btnRegister_Click(object sender, EventArgs e)
|
||||||
CreateChromeHostManifest(Program.ChromeHostManifestPath);
|
CreateChromeHostManifest(Program.ChromeHostManifestPath);
|
||||||
|
|
||||||
RegistryHelpers.RegisterChromeSupport(Program.ChromeHostManifestPath);
|
RegistryHelpers.RegisterChromeSupport(Program.ChromeHostManifestPath);
|
||||||
|
|
||||||
|
MessageBox.Show("Chrome support enabled.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -86,6 +88,8 @@ private void btnUnregister_Click(object sender, EventArgs e)
|
||||||
}
|
}
|
||||||
|
|
||||||
RegistryHelpers.UnregisterChromeSupport();
|
RegistryHelpers.UnregisterChromeSupport();
|
||||||
|
|
||||||
|
MessageBox.Show("Chrome support disabled.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +99,7 @@ private void btnUnregister_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void btnInstallExtension_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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue