0

i am using gecko browser to navigate to a site and the site leaves a cookie that i want to delete after im done with it. how do i delete cookies from my gecko browser?

oh and does anyone know how to implement a proxy system into my browser the one way i know is

status.Items.Add("Setting Proxy")
        Skybound.Gecko.GeckoPreferences.User("network.proxy.type") = 1
        Skybound.Gecko.GeckoPreferences.User("network.proxy.http") = TextBox2.Text
        Skybound.Gecko.GeckoPreferences.User("network.proxy.http_port") =

but with that way i cannot grab info from a textbox when setting the proxy port

user2475033
  • 33
  • 1
  • 6

1 Answers1

0

For deleting entire cookie :

nsICookieManager CookieMan;
            CookieMan = Xpcom.GetService<nsICookieManager>("@mozilla.org/cookiemanager;1");
            CookieMan = Xpcom.QueryInterface<nsICookieManager>(CookieMan);
            CookieMan.RemoveAll();        

And for assigning port , you have to provide the integer value not a string.

Skybound.Gecko.GeckoPreferences.User("network.proxy.type") = 1;
Skybound.Gecko.GeckoPreferences.User("network.proxy.http") = TextBox2.Text;
Skybound.Gecko.GeckoPreferences.User("network.proxy.http_port") = 8080;

If you are getting proxy value from textbox , Split that using ':' and assign as follows

Skybound.Gecko.GeckoPreferences.User("network.proxy.type") = 1;
Skybound.Gecko.GeckoPreferences.User("network.proxy.http") = TextBox2.Text.Split(':')[0];
Skybound.Gecko.GeckoPreferences.User("network.proxy.http_port") = int.Parse(TextBox2.Text.Split(':')[1]);
yasmuru
  • 1,178
  • 2
  • 20
  • 42