RevBrowser in WindowsXP

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Fri Apr 18, 2008 12:04 am

Hello Mark

I started with the name and nothing

Followed with the transparency and gotcha!

What a strange behavior. I know what to do now.

Thanks for your help
Andres

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Fri Apr 18, 2008 2:04 pm

Hello Mark

After redesigning the window shape for the Win version, I found that the browser is now showing but the rest of the code is not working.

What I have is a browserDocumentComplete handler that reads the contents of the page just loaded like this...

Code: Select all

ON browserDocumentComplete pId, pUrl
        put revBrowserGet(pId, "htmltext") into pagecontents
   	...
This code works on OSX but not on Windows. In Windows, the revBrowserGet function returns not the current page but the previous one.

I have tried inserting a wait with messages command in the middle (to give some time for the variable to populate) but it does not work. The only way to get the current page data is by retrieving a next page.

Do you know what can be happening?

Thanks
Andres

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

Post by Mark » Fri Apr 18, 2008 2:25 pm

Hi Andres,

I just sent you an e-mail with an answer to your first question, which is also discussed here: http://quality.runrev.com/qacenter/show_bug.cgi?id=6411

The answer to your second questions also resulted in a bug report: http://quality.runrev.com/qacenter/show_bug.cgi?id=6412

Following a copy of my answer:
I think you are right and I have no idea why this happens. I exported your picture from the stack to an image editor, made the picture gray, flattened the image, re-created a transparent area, and exported it back to Revolution. This worked. I have also tested both of your pictures and indeed the first doesn't work, while the seconds does.

I believe there is a problem with the alpha mask, which allows for the smooth corners. Apparently, this alpha mask doesn't go together with the revBrowser. The browser gets created and the page loads, but the contents of the browser window is not rendered --at least not in the correct layer.

When I exported the original picture from your stack to the image editor, I noticed that you were using an alpha mask to make parts of the picture transparent while other parts are opaque. I haven't tested this, but it looks like Revolution can't cope with that.

You probably have seen that the non-smooth corners cause a few pixels to be left white. Therefore I'd turn off the shadow of your stack. Unfortunately, when I tried to create a window shape with shadow, to make the stack shadow unnecessary, I got the same problem again.

Regarding your second e-mail, I'd say that's a bug as well. I work around it with the following script:

Code: Select all

on browserDocumentComplete theID,theURL
 send "getBrowserHtmlText theID,theURL" to me in 0 millisecs
end browserDocumentComplete theID,theURL

Code: Select all

on getBrowserHtmlText theID,theURL
 put revBrowserGet(theID,"htmlText") -- into some global var if you want
end getBrowserHtmlText
Let me know if this works for you.

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

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Fri Apr 18, 2008 2:42 pm

Hello Mark

Your workaround worked around perfectly. Thank you very much for your help!

One last question... with the new shape for Windows, when the stack switches shapes it flickers.

I tried the lock screen command but it does not work. Do you know of any way to solve this?

Andres

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Fri Apr 18, 2008 5:40 pm

Hello Mark

Sorry, but I need to bring another issue...

This is my first project with RevBrowser, and in fact I always wondered what was it good for. Well, now I see no other way for my applications to integrate with the complexity of the Facebook authentication system.

There are three valuable tasks performed by RevBrowser in this particular project: ajax code, ssl comunication and cookies handling. And regarding the last one, it seems to me that the Windows version is not registering the cookies as the OSX is.

My observation comes from the fact that OSX version is able to login again without asking for credentials, but the Win version always asks for credentials after a previous successful login.

Andres

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

Post by Mark » Mon Apr 21, 2008 10:33 pm

Hi Andres,

Is it possible that some Windows safety mechanism is getting in the way? Perhaps, there is an Internet option turned on, which prevents the browser from storing cookies?

If you are sure that all settings are correct, you might have a look at this:
http://article.gmane.org/gmane.comp.ide ... user/11227

It is not easy, but it might provide you a way to store cookies, if you can make the Facebook website in the browser co-operate with the scripts in your stack.

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

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Mon Apr 21, 2008 10:58 pm

Hello Mark

I have lowered the security level to allow all cookies and still the same problem.

I know about the different html-headers commands but they only work if all html requests are made within revolution.

As far as I know, there is no way to set up or read the Safari or Explorer headers when using RevBrowser.

Andres

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

Post by Mark » Tue Apr 22, 2008 1:10 pm

Hi Andres,

You would have to handle all the navigation by means of script, using browserClick, browserBeforeNavigate and many other message. That would allows you to get and set coockies as well. Your scripts would to the actualy nagivation, while the browser only displays the resulting html. This is complex and laborious and I didn't do this myself, but should be possible if your project depends on it.

Then again, I still wonder why you have this problem and I am not convinced that revBrowser on Windows is really unable to deal with cookies. Maybe it is a Rev bug. You could ask on the Rev Mail List whether more people have this issue.

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

andres
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 68
Joined: Thu Jan 04, 2007 2:24 am

Post by andres » Tue Apr 22, 2008 2:04 pm

Thanks again Mark

I will ask the mail list.

Andres

Post Reply