From 4c4df2660c95f7c0efade0c8436ef7a7b29225ff Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 29 Aug 2015 04:24:21 +0300 Subject: [PATCH] In debug don't check for extension id --- ShareX/Forms/ChromeForm.cs | 8 +++++++- ShareX/UploadTask.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ShareX/Forms/ChromeForm.cs b/ShareX/Forms/ChromeForm.cs index ee401d4cf..c84bc49cb 100644 --- a/ShareX/Forms/ChromeForm.cs +++ b/ShareX/Forms/ChromeForm.cs @@ -48,13 +48,19 @@ public ChromeForm() private void CreateChromeHostManifest(string filepath) { + string id = ""; + +#if !DEBUG + id = "chrome-extension://nlkoigbdolhchiicbonbihbphgamnaoc/"; +#endif + var manifest = new { name = "com.getsharex.sharex", description = "ShareX", path = Program.ChromeHostPath, type = "stdio", - allowed_origins = new string[] { "chrome-extension://nlkoigbdolhchiicbonbihbphgamnaoc/" } + allowed_origins = new string[] { id } }; string json = JsonConvert.SerializeObject(manifest, Formatting.Indented); diff --git a/ShareX/UploadTask.cs b/ShareX/UploadTask.cs index 3d78b269f..f9af37133 100644 --- a/ShareX/UploadTask.cs +++ b/ShareX/UploadTask.cs @@ -1291,13 +1291,13 @@ private bool DownloadAndUpload() if (!string.IsNullOrEmpty(Info.FilePath)) { - Helpers.CreateDirectoryIfNotExist(Info.FilePath); - Info.Status = Resources.UploadTask_DownloadAndUpload_Downloading; OnStatusChanged(); try { + Helpers.CreateDirectoryIfNotExist(Info.FilePath); + using (WebClient wc = new WebClient()) { wc.Proxy = HelpersOptions.CurrentProxy.GetWebProxy();