Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [atf-dev] Adding a JavaScript object on Mozilla

Thanks,

      Yes, I’m using the Mozilla Embedded Browser, opened by the line MozBrowserUtil.openMozillaBrowser(url). Where I can find some documentation about DOM API’s? I try doing in this way, but didn’t work…

 

private static MozillaBrowser browser;

browser = MozBrowserUtil.openMozillaBrowser(url);

nsIDOMDocument document = browser.getDocument();

      nsIDOMNode head = document.getElementsByTagName( "HEAD" ).item(0);

      nsIDOMHTMLScriptElement script = (nsIDOMHTMLScriptElement)(document

.createElement("SCRIPT")

.queryInterface(nsIDOMHTMLScriptElement.NS_IDOMHTMLSCRIPTELEMENT_IID));

      // Hidden tag from the tools

      script.setAttribute( "class", MozIDEUIPlugin.ATF_INTERNAL );

      nsIDOMText scriptContent = document.createTextNode( scriptBuffer.toString() );

      script.appendChild( scriptContent );

      head.appendChild( script );

 

Thanks again,

Victor Emanuel

 


From: atf-dev-bounces@xxxxxxxxxxx [mailto:atf-dev-bounces@xxxxxxxxxxx] On Behalf Of Gino Bustelo
Sent: quarta-feira, 27 de junho de 2007 16:40
To: AJAX Toolkit Framework discussion
Subject: Re: [atf-dev] Adding a _javascript_ object on Mozilla

 

Not exactly sure what you mean... If you are referring to the ATF's Embedded Browser, to add _javascript_ to a page you can use the DOM APIs to add a Script tag and then set the content text with your script.

Thanks,
Gino Bustelo
ATF Developer

On 6/27/07, Victor Emanuel Perticarrari Osorio <victor.osorio@xxxxxxxxxxxxxxx > wrote:

Hi,

            Anyone knows a way to set a new _javascript_ object on Mozilla. I have some _javascript_'s objects that I want the user thinks they are default object of the navigator. It's possible doing this in Mozilla?

 

Thanks,

Victor Emanuel

 

Victor Emanuel Perticarrari Osório 
Eldorado Research Institute
victor.osorio@xxxxxxxxxxxxxxx

 


_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev

 


Back to the top