On 2010.04.05, at 3:15 PM, Jonathan Wadelius wrote:
Hi,
Another question that is probably more related to the _javascript_ syntax. I have looked in the GIR file and figured out why my calls are not working, not because the functions don't exist, but because they are not functions but methods. I've not coded in _javascript_ before and do not know how to call a method. Do I need a specific instance of an object to call it from?
Yes, you need an instance of an object to call methods on.
If I for example want to call the "save" method in the "EphySession" class, how do I get the object from Epiphany?
An EphyShell object has a .get_session() method which returns the associated EphySession.
So... perhaps
Epiphany.EphyShell.get_default().get_session()
I don't know if this works (I'm not at a box with GNOME installed at the moment), but something similar should.
In "reopen-closed-tabs" the EphyWindow is passed to the function as an argument. Any way to change that to an EphySession object?
Nope (and as you can see above, not necessary).
Sorry for all the questions. Your answers are really helping!
:-)
//
Jonathan