/// <summary> /// Creates chrome extension (.crx) for proxy authentication /// </summary> /// <param name="username">Travian username</param> /// <param name="server">Travian server</param> /// <param name="access">Access</param> /// <returns>Path of the chrome extension</returns> public static string CreateExtension(string username, string server, Access access) { var cacheDir = IoHelperCore.GetCacheDir(username, server, access); var dir = Path.Combine(cacheDir, "ProxyAuthExtension"); Directory.CreateDirectory(dir); CreateFile(Path.Combine(dir, "manifest.json"), manifestJson); CreateFile(Path.Combine(dir, "background.js"), GenerateBackgroundJs(access)); var zipPath = Path.Combine(cacheDir, "chromeExtension.crx"); if (File.Exists(zipPath)) { File.Delete(zipPath); } ZipFile.CreateFromDirectory(dir, zipPath); return(zipPath); }