11

I'm Using Geckfx18.0 and xulrunner18.01. Since Geckofx share cookie and user preferences with others instance so I try to create a new profile directory to make them have unique setting but it seems to be no use. here is my code. Is there any problem with my code?

String profileDir = port.ToString();
string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Path.Combine("Geckofx", profileDir));
this.Text = directory.ToString();

if (!Directory.Exists(directory))
    Directory.CreateDirectory(directory);

Gecko.Xpcom.ProfileDirectory = directory;
GeckoPreferences.User["network.proxy.type"] = 1;
GeckoPreferences.User["network.proxy.socks"] = "127.0.0.1";
GeckoPreferences.User["network.proxy.socks_port"] = port;
GeckoPreferences.User["network.proxy.socks_version"] = 5;
GeckoPreferences.User["general.useragent.override"] = ua;
Parrish Husband
  • 3,148
  • 18
  • 40

1 Answers1

-1

Are you initializing the instance of Gecko before setting the ProfileDirectory?

Note that the XpCom.ProfileDirectory is a static property, so if you're trying to start each instance, keep in mind you may be undoing the path you set previously.

Additionally, rather than settings the preferences in code, you save your user preferences out to a file via GeckoPreferences.Save(). Then you can load them back in to support diferent users via GeckoPreferences.Load().

Parrish Husband
  • 3,148
  • 18
  • 40
  • 1
    I am not. I have 4 standard gecko browsers and trying to set different proxies to each one, constantly. Do i need to recreate every browser before use it? I am sorry, i can not share any code here since it is not my thread. I just found it and added the bounty since i have the same issue – user2530266 Sep 08 '18 at 21:32
  • 1
    @user2530266 you should create a new question with the relative details and reference back to this bounty, that way you get to state your specific problem. – Nkosi Sep 08 '18 at 22:04
  • 1
    @Nkosi there is no reason. I have exactly the same problem. And the same code in a loop... – user2530266 Sep 09 '18 at 19:58
  • 1
    @user2530266 ok then. it was just a suggestion in case you wanted to add more details which would have been easier to notice than in a comments thread. – Nkosi Sep 09 '18 at 20:07