Custom Browser elements in Firefox
Posted: Tue Oct 30, 2012 1:08 am
Hello.
In my company I'm a Firefox extension developer. In our extension there are some custom XUL dialogs with XUL browser elements that contain HTML pages. Problem is that Ranorex doesn't recognize those pages as HTML DOM pages. The only thing i can see is accessibility elements. That made me sad, so i looked in Ranorex FF extension and wrore a little script that allow to add custom browser elements to Ranorex:
http://pastebin.com/73rMP8Pw
Usage is like this:
Assuming that XUL looks something like this:
1. There is Ranorex NP plugin that added to every browser window. For now i can't understand how it used and i don't insert it to my XUL page. Should i?
2. Ranorex can easily monitor HTML browser elements by itself. Can that be implemented?
3. Implementation of Firefox extension using XPCOM is terrible as it requires a updates of extension for each FF release. I know what i'm saying and i'm sure that implementation fully can be moved to NP API plugin and pure javascript. In this case you won't need to release new Ranorex version each time FF updates. And i'm sure that won't require a much afford.
In my company I'm a Firefox extension developer. In our extension there are some custom XUL dialogs with XUL browser elements that contain HTML pages. Problem is that Ranorex doesn't recognize those pages as HTML DOM pages. The only thing i can see is accessibility elements. That made me sad, so i looked in Ranorex FF extension and wrore a little script that allow to add custom browser elements to Ranorex:
http://pastebin.com/73rMP8Pw
Usage is like this:
Code: Select all
RMRanorexAttacher.AttachBrowser(document.getElementById("dialog_content_browser"));
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="window1" xmlns="http://www.mozilla.org/keymaster/gateke ... s.only.xul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mozilla.org/keymaster/gateke ... s.only.xul"> <script src="page_script.js" type="application/x-javascript" /> <browser id="dialog_content_browser" type="content" flex="1" /> </window>That works great and i can use DOM of custom browser in Ranorex. Possibly that can help someone else. However, there are some questions, comments and feature requests:
1. There is Ranorex NP plugin that added to every browser window. For now i can't understand how it used and i don't insert it to my XUL page. Should i?
2. Ranorex can easily monitor HTML browser elements by itself. Can that be implemented?
3. Implementation of Firefox extension using XPCOM is terrible as it requires a updates of extension for each FF release. I know what i'm saying and i'm sure that implementation fully can be moved to NP API plugin and pure javascript. In this case you won't need to release new Ranorex version each time FF updates. And i'm sure that won't require a much afford.