0

I am using skybound.geckofx .net wrapper to show stored web content in my winforms app. Some of this pages has links and js refers to online content. Is any simple way to disable downloading online content in geckofx wrapper ?

user861768
  • 175
  • 1
  • 12

1 Answers1

1
browser.Navigating += (sender, args) => { if (IsLinkOnLine(sender.Uri)) args.Cancel = true; };

Where IsLinkOnLine is a function that returns true if Uri referees to 'online content'.

browser is a GeckoWebBrowser instance.

I would also recommend using a newer version of geckofx https://bitbucket.org/geckofx/ if you've not already.

Tom
  • 6,325
  • 4
  • 31
  • 55
  • Thanks for answer, is browser.Navigating deals with ajax calls ? (e.g. $.get from js) – user861768 Mar 14 '13 at 06:06
  • not sure - would think not. disabling javascript would be a way of disabling ajax. – Tom Mar 14 '13 at 06:27
  • Setting javascript.enabled to false, can be done like GeckoPreferences.User["javascript.enabled"] = false; – Tom Mar 14 '13 at 06:43
  • The main goal is make offline pages looks like "online" versions (allow js to manipulate dom), but without downloading any content from network (requirement). I am thinking about implementing dummy proxy and set it to browser – user861768 Mar 14 '13 at 07:54