Hello, everyone,
I met a problem :(
I can not find an api of Embedded Mozilla Browser in eclipse plug-in
development.
Here is the problem:
1. background, a example:
A node in web page maybe like: <li id="abc" ...>...</li>
And body node maybe like: <body init="initOnClick" ..>...</body>
initOnclick may be:
function initOnClick() { document.getElementById('abc').onclick =
function(){...} }
After page loaded, this function will be called.
When I get DOM tree of this web page after it loaded in Embeded Mozilla
Browser, I can get that li element with id='abc', but it's onclick attribute
is empty.
I have checked that I enabled javascript in Embedded Mozilla Browser.
I have used firebug in Mozilla 2.0 and find that the element([EMAIL
PROTECTED]'abc'])
actully didn't have the 'onclick' attribute,
but the script object which represents the dom element has an attribute
called 'onclick' with a script function() value, which is I really want to
get.
The problem is: How can I get this 'onclick' attribute?
2.I think there are two approaches:
One:
Find an api to get a script object which represents the element, or a
javascript context which represents the whole web page.
Maybe use queryInterface, but I didn't find an appropriate Interface to
query to.
The other:
Find an api to get script engine of this web page, so that I can call
eval method to run my script like: return document.getElementById
('abc').onclick;
I tried to insert some nodes include a script node and tried to invoke
browser to parse and execute my script, but I failed at last.
Maybe there are some other ways, I didn't think.
I use xulrunner 1.8.1.0, eclipse 3.3, sun JRE 5.0.
I didn't know whether I submit the question in the right place.
Please do not give me xulplanet link, I have browsed xulplanet throughly.
I need a clear and exact answer. I hope any body can help me.
If I post it in a wrong place. Will you please tell me where should I post
it?
Thank you in advance.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding