Mozilla
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Mozilla

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 3rd, 2007, 12:20 PM
victor.perticarrari
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Adding new JavaScript objects to ATF Browser

Hi,
I need to add some new javascript objects in a ATF's Embedded
Browser instance (ATF Eclipse). Someone knows how to do this? I'm
calling the browser by: (url)

Thanks,
Victor Emanuel


dev-embedding mailing list
dev-embedding (AT) lists (DOT) mozilla.org

Reply With Quote
  #2  
Old July 4th, 2007, 06:20 AM
EliteLama
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Adding new JavaScript objects to ATF Browser

Jul 3, 6:16 pm, victor.perticarr (AT) gmail (DOT) com wrote:
Hi,
I need to add some new javascript objects in a ATF's Embedded
Browser instance (ATF Eclipse). Someone knows how to do this? I'm
calling the browser by: (url)
>

Thanks,
Victor Emanuel

Maybe you could do this by creating and adding a script-node to the
DM in the embedded browser. But as far as I know you can only invoke
those scripts by writing your own xpcom component. Because with the
MozillaBrowser execute method you can get no return value.

With browser.getDocument(); you can get the nsIDMDocument from the
MozillaBrowser. Then you have to find the nsIDMNode which you want to
attach the script to. With node.appendChild(newnode); you can append a
new child to the node you found.
I have not tried this on my own so please correct me if I'm wrong.

Good Luck,
Christopher


dev-embedding mailing list
dev-embedding (AT) lists (DOT) mozilla.org

Reply With Quote
  #3  
Old July 4th, 2007, 07:20 AM
victor.perticarrari
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Adding new JavaScript objects to ATF Browser

Thanks,
I have already try this, but I found some problems.
When I open the browser and set a url, I don't have the html page
open immediately. So I don't have the DM document to change, only
when the page have been loaded.
And the problom is not only for the open html page, if the user
use IFrames, my javascript objects must be accessible for all iframe.
Is something like create a new default object, like document or
window
Do you know how to do this I'm reading everything in the
internet for many day, but I can find a good documentation for
mozilla

thanks


4 jul, 04:30, EliteLama <elitel (AT) gmx (DOT) atwrote:
Maybe you could do this by creating and adding a script-node to the
DM in the embedded browser. But as far as I know you can only invoke
those scripts by writing your own xpcom component. Because with the
MozillaBrowser execute method you can get no return value.
>

With browser.getDocument(); you can get the nsIDMDocument from the
MozillaBrowser. Then you have to find the nsIDMNode which you want to
attach the script to. With node.appendChild(newnode); you can append a
new child to the node you found.
I have not tried this on my own so please correct me if I'm wrong.
>

Good Luck,
Christopher



dev-embedding mailing list
dev-embedding (AT) lists (DOT) mozilla.org

Reply With Quote
  #4  
Old July 4th, 2007, 07:20 AM
victor.perticarrari
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Adding new JavaScript objects to ATF Browser

The same problem:



dev-embedding mailing list
dev-embedding (AT) lists (DOT) mozilla.org

Reply With Quote
  #5  
Old July 10th, 2007, 08:01 AM
EliteLama
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Adding new JavaScript objects to ATF Browser

victor.perticarr (AT) gmail (DOT) com schrieb:
The same problem:


You can create your own XPCM component with javascript. If you make
it a singleton implementation you can access the component with its
attributes and functions from your Java application and from the
javascript in the document. This solution worked well for me.

For more information about writing xpcom components take a look at:




dev-embedding mailing list
dev-embedding (AT) lists (DOT) mozilla.org

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Mozilla > Adding new JavaScript objects to ATF Browser


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway