Skybound Software is looking to hire experienced C# developers to work on Stylizer and other forthcoming Skybound products. Click here for details.
GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control. Download GeckoFX @ Google Code >
GeckoFX is made by Skybound Software, authors of Stylizer—the professional CSS editor with a strong focus on visual control, error-free workflow, and productivity. Learn About Stylizer >
Discuss GeckoFX, the Open-Source Gecko Control for .NET
You are not logged in.
Pages: 1
Hi everyone?
Do anybody know how to implement the nsIDOMLoadStatus interface properly??? I need to catch the Loaded attribute. Can it be associated to the nsIDOMEventTarget too? (check GeckoWebBrowser, OnHandleCreated method for reference)
Please describe if possible
Thanks in advance for your time.
Offline
Can't you use the DOMContentLoaded event instead, much easier to implement, or do you need the specifics of the other event?
/Cheers
Offline
Well, in fact I need to detect the DOMContentLoaded and load event to set some metrics in my application (as detected by firebug for example) http://www.softwareishard.com/blog/fire … e-monitor/.
I tried to implement this event (as referred here http://geckofx.org/viewtopic.php?id=434) without sucess.
Any other ideas?
Thanks in advance
Offline
Hi, I glad to help!
Well I've done it this way:
inside GeckoDomEvents.cs add:
public delegate void GeckoDOMContentLoadedEventHandler(object sender, GeckoDomEventArgs e);
inside GeckoWebBrowser.cs find:
protected override void OnHandleCreated(EventArgs e)
find
target.AddEventListener(new nsAString("click"), this, true);add this
target.AddEventListener(new nsAString("DOMContentLoaded"), this, true);sets the event listner, I found that the DOMContentLoaded gets fired per default, without any interface adding.
find the method
void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
add to the switch
case "DOMContentLoaded": OnDOMContentLoaded(ea = new GeckoDomEventArgs(e)); break;
find the region "public event GeckoDomEventHandler DomSubmit" as you can see I've just copied the structure.
Add the following
region public event DOMContentLoadedEventHandler DOMContentLoaded
[Category("DOM Events")]
public event GeckoDOMContentLoadedEventHandler DOMContentLoaded
{
add { this.Events.AddHandler(DOMContentLoadedEvent, value); }
remove { this.Events.RemoveHandler(DOMContentLoadedEvent, value); }
}
private static object DOMContentLoadedEvent = new object();
protected virtual void OnDOMContentLoaded(GeckoDomEventArgs e)
{
if (((GeckoDOMContentLoadedEventHandler)this.Events[DOMContentLoadedEvent]) != null)
((GeckoDOMContentLoadedEventHandler)this.Events[DOMContentLoadedEvent])(this, e);
}
#endregionHope this helps
//Cheers
Krippz
Offline
Thank you so much my friend!!!
Best regards
:cool:
Offline
Big thanks to KrippZ,
With all your posts, I have managed to hook into all the normal and custom events I need to wrap up the system.
Offline
I added this to my compile of GeckoFX and it works a treat.
@KrippZ...great work man. It's a fairly simple solution but you have saved me loads of time thus far! Thanks again!!!!!!!!
Offline
Does this event fires on AJAX requests ?
I need a way to detect when AJAX loading finishes....
Offline
Pages: 1