revBrowser - Focus

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dickey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Wed Apr 08, 2009 11:54 pm

revBrowser - Focus

Post by dickey » Thu Mar 11, 2010 12:34 pm

Hello All,

How do I change focus to a revBrowser instance (id say 54)?

There are focus commands in the depreciated XBrowser library: XBrowser_Focus / XBrowser_Unfocus, but none to my knowledge in the revBrowser library.

Interestingly, the revBrowser object when invoked does not list in the Application Browser.

Without a revBrowser library function for focus/unfocus I am not sure how to use rev code (statements such as click and type) to interact with the revBrowser.

The revBroswer library will allow a developer to interact with a webpage (automate tasks) by executing javascript (revBrowserExecuteScript), however I was hoping to use both methods for automating browser tasks: Method 1: direct rev code to click and type for flash, and silverlight sites, and Method 2: using JS calls to automate regular sites where you can from the source identify object ids.

Any assistance greatly appreciated.

Kind regards, Andrew

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowser - Focus

Post by Mark » Thu Mar 11, 2010 2:54 pm

Hi Andrew,

You seem to be confused about the fact that the browser window is not a native object. It is a separate window that's layed over the stack window and you can interact with it only by means of revBrowser commands and direct user input.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dickey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Wed Apr 08, 2009 11:54 pm

Re: revBrowser - Focus

Post by dickey » Fri Mar 12, 2010 3:11 am

Thank you for your reply Mark,

Whilst I may sound confused I am just puzzled at the seeming gap in functionality between the old and new browser libriaries.

I already understood from experimentation that the browser window was not a native Rev object. The experiment: I placed a button beneath the location of the rect of the revBrowser and then using click at x,y to determine whether it would click within the revBrowser or the stack window behind it. The click actioned the button of the stack window (behind) and not the browser window. I was hoping the opposite would have been the case. This supports your advice Mark. That then led me to think it was a question of focus. If I could first push focus to the revBrowser or XBrowser window, might then I be able script what is termed 'direct screen' actions (click at x,y etc), to automate sites where automation via javascript is inappropriate.

I experimented with the legacy XBrowser library, specifically XBroswer_Focus, but that does not work either.

It would have been very powerful, to have the ability to focus on the revBrowser object and use non revBrowser library code to interact with the page (such as click and type).

Does anyone know why this functionality was lost? and whether revBrowser will be extended to include it again at some point?

Mark, again thanks for your interest.

Kind regards, Andrew

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowser - Focus

Post by Mark » Fri Mar 12, 2010 9:34 am

Hi Andrew,

I am not even sure whether the XBrowser_Focus command actually brought a particular browser instance to front. I think it just set the focus. Setting focus without bringing the browser instance to front might have caused problems.

Usually, I just show and hide browsers. I show the next browser, set it's rect to that of the previous one and then hide the previous one.

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply