3

I wanted to implement the Facebook Like button into my C# application using the Web Browser control but i encountred a problem with Internet Explorer (After clicking on like button, the facebook login popup appears) but iexplore block and ask me whether to recover the page.

Therfore, i downloaded geckoFx to embed Mozilla on my application instead of the in built Web Browser control ! But now when i click on the Like button on the Gecko browser, i get a blank page. And when i right click the page to view the source i don't see anything (blank page)

Maybe the problem is either the GeckoFX browser doesn't support Popups or doesn't support Javascript

How to implement Facebook Like Button inside GeckoFX browser in C# Windows Forms ?

I'm using XUL runner 1.9.1.19

Rafik Bari
  • 4,867
  • 18
  • 73
  • 123
  • "implement the like button" as in, you want to like your own page or you want to embed other page's like buttons ? what kind of error messages you get upon debugging ? – Alex Sep 17 '12 at 12:00
  • I want to implement other pages like buttons. I got the code from here http://developers.facebook.com/docs/reference/plugins/like/ – Rafik Bari Sep 17 '12 at 12:02

1 Answers1

1

New Windows and tabs are not handled automatically. You need to create events for those:

private void webBrowser_CreateWindow(object sender, GeckoCreateWindowEventArgs e) {
    e.WebBrowser = NewWindow();
}

private void webBrowser_CreateTab(object sender, GeckoCreateTabEventArgs e) {
    e.WebBrowser = NewWindow();
}

private GeckoWebBrowser NewWindow() {
    BrowserForm frm = new BrowserForm();
    frm.Show();
    return frm.WebBrowser;
}

Here BrowserForm must contain a public property that points to the GeckoWebBrowser control.

Sire
  • 4,086
  • 4
  • 39
  • 74