Browser Library Related Questions - Needs answers fast.. T_T

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Browser Library Related Questions - Needs answers fast.. T_T

Post by shadowslash » Fri May 01, 2009 9:55 pm

I'm encountering problems when I'm using the browser library... Please help me with the following matters...

1. I don't think browserCancel isn't working anymore because the code below doesn't work.

Code: Select all

on browserBeforeNavigate theBrowserId,theURL
   if theBlockedURLS contains theURL then
      global browserCancel
      put TRUE into browserCancel
   end if
end browserBeforeNavigate
If you're saying this might be a bug in my script, then here's another thing, I tried the code below but the browser still continues to load the destination URL.

Code: Select all

on browserBeforeNavigate theBrowserId,theURL
   global browserCancel
   put TRUE into browserCancel
end browserBeforeNavigate
2. The browserDownloadRequest message doesn't seem to be functioning right as well. If I'm right, the browserDownloadRequest message must catch if a user is trying to download a file. It does do that but it doesn't prevent the download window from appearing. I need to block the download window first then ask the user if he or she wants to download that certain file.

Code: Select all

on browserDownloadRequest theBrowserId,theURL
   global browserCancel
   put TRUE into browserCancel
   answer question "Are you sure you want to download" && theURL && "?" with "Cancel" or "Download" titled "Download Request"
   if it is "Download" then
      ask file "Save" with type "All File Types|"
      if it is not empty then
         put url theURL into url("binfile:" & it)
      end if
   end if
end browserDownloadRequest
Now the script above must function quite smoothly but it won't. For some odd reason, the download window of Internet Explorer pops up along with the answer box that I made.

3. The whole Runtime Revolution environment (development and standalone application) crashes whenever a frame in a loaded page does not exist. For example, if the HTML file contains the code below,

Code: Select all

<html>
<head>
<title>test page</title>
</head>
<body>
<iframe src="http://somesitethatdoesntexist.com">Frames are not enabled in your browser please enable it first.</iframe>
</body>
</html>
then I try to load it into a card containing my browser object, the whole program crashes. Also in addition, I need to know how to redirect a page inside a frame because I've made a custom error page that's supposed to be displayed if a site / page / file that's been loaded into the browser object is not found. The error page is working great for normal webpages but for frames, not at all.

It's really frustrating guys so PLEASE HELP ME OUT... I think there're more and more questions that's gonna come up so please don't get tired of answering my questions please? Image
Parañaque, Philippines
Image
Image

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Mon May 04, 2009 8:07 pm

I came across the same issue, it's blocking development on an app due for delivery.
Bug report: http://quality.runrev.com/qacenter/show_bug.cgi?id=8036

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue May 05, 2009 11:41 am

It seems this was broken between Rev 3.5.0-dp-2 and Rev 3.5.0-dp-3. Since 3.5.0-dp-3 onwards, the browserCancel status is not being honoured.


Assuming the thing can be fixed and/or I can make it work using 3.5.0-dp-2 (not sure yet what I'll lose and whether that will create its own problems) is there a way to use browserBeforeNavigate (and browserBeforeNavigateFrame) to intercept the url specified, and if required, redirect it to something else? Changing the url parameter passed to the browserBeforeNavigate handler doesn't change the url the browser actually navigates to. Can this be done?

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Tue May 05, 2009 12:59 pm

In theory you should be able to take the browser external from dp2 and just pop it into the 3.5 dev environment. Would you care to try this and let us know if that worked?

Cheers,

Malte

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue May 05, 2009 4:59 pm

Seemingly not. I'm not sure what it's doing now. I think I now need to roll back and try again.

Anyway, Oliver has confirmed the bug report and mentions that the issue should be fixed in the next build, and I can probably work with this in DP-2 until that time.

Any thoughts on how to intercept browser navigation to change the destination url if the url passed to the browserBeforeNavigateFrame matches a given pattern?

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed May 06, 2009 12:28 pm

I can definitely live with it until the next build! gm-2 is available now, and includes the fix for browserCancel. :D

There still seems to be an issue with browserDownloadRequest though - on clicking a download link, the browserBeforeNavigate (or browserBeforeNavigateFrame) handler is triggered, so the logic can be moved there I think, but browserDownloadRequest never seems to be activated (that I can tell).

I still need (in particular with a frameset... :roll: ) to be able to intercept and redirect a url rather than just cancelling the navigation, if that's possible.

I can fudge a bit like

Code: Select all

on browserBeforeNavigate pId, pUrl
  if validateUrl(pUrl) is false then
    put false into browserCancel
    send "revBrowserSet pId," & quote & "url" & quote & ", sRedirectUrl" to this card in 200 milliseconds
  end if
end browserBeforeNavigate
but unfortunately this won't work in the frameset (over which structure I unfortunately have no control).

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Fri May 08, 2009 11:28 am

thank you so much guys for the reply... since this topic doesn't seem to have been solved yet, i guess i'll just have to put aside my project for this one and move on the other... i made a new topic for that because i don't think it's anywhere related to this matter... if ever u're interested, the link to my post is http://forums.runrev.com/phpBB2/viewtopic.php?t=3040
Parañaque, Philippines
Image
Image

Post Reply