Getting Radio to open the Desktop Website in Mozilla Firebird during startup - Part 3

| 3 Comments

This is part 3 in a series which explores Radio's problems in using the Mozilla Firebird browser on Radio startup and some possible solutions.

Parts in the series:
Introduction
Part 1 - Radio uses the default application to open ".htm" files
Part 2 - Radio does not parse the Mozilla Firebird command line correctly.
Part 3 - Radio does not use the correct DDE name to "talk" to Mozilla Firebird.

Part 3 - Radio does not use the correct DDE name to "talk" to Mozilla Firebird.

DDE (Dynamic Data Exchange) is a means for two programs to "talk" to each other - to pass commands, data, etc., back and forth between the two programs. When Radio starts up, it starts the default web browser and then uses DDE to tell the open browser window to open the url of the Desktop Website home page.

One of the parameters that is required in DDE is the DDE application name. The DDE application name is used to tell which DDE messages and commands an application should listen to and which ones it should ignore. If a DDE command is received by an application, but the DDE application name sent does not match the DDE application name that the application is listening for, that application will ignore the message.

Typically, the DDE application name is the same as the filename of the .exe (less the .exe), but this is not always the case. Radio assumes that the DDE application name is the same as the .exe file name, and this causes a problem in the case of Mozilla Firebird.

Mozilla Firebird's .exe name is "MozillaFirebird" (no space between the names), but its DDE application name is "Mozilla Firebird" (one space between the names).

Assuming that Radio can successfully start Mozilla Firebird (see parts 1 and 2), Radio tries to tell Mozilla Firebird via DDE to open the Desktop Website home page, using the DDE application name of "MozillaFirebird" in the communication. Since Mozilla Firebird is listening for the DDE application name of "Mozilla Firebird", it ignores all such DDE commands sent by Radio, and does not open any url at all.

There is no easy fix available to this behavior in Radio. The actual code in radio.root must be modified by Radio Userland via a radio.root update, or the user must modify the code on their own.

The code in question is within system.verbs.builtins.webBrowser.openURL:

case sys.os ()
  "MacOS"
    return (appleEvent (id, 'GURL', 'GURL', '----', string (s), 'cwin', openUrlIn))
  "Win95"
  "WinNT"
    if string.lower (id) contains \"netscape\"
      return (webBrowser.callBrowser (id, "WWW_OpenURL", s + ",,-1"))
    return (webBrowser.callBrowser (id, "WWW_OpenURL", s))

Radio is sending the DDE command to the browser in the webBrowser.callBrowser macro call. The "id" parameter is the DDE application name, "WWW_OpenURL" is the DDE command for the browser to open a specified url, and "s" is the url to open.

Mozilla Firebird needs a DDE command like Netscape's, but tailored for Mozilla Firebird. I would change the above code by adding two lines so that it looks like the following:

case sys.os ()
  "MacOS"
    return (appleEvent (id, 'GURL', 'GURL', '----', string (s), 'cwin', openUrlIn))
  "Win95"
  "WinNT"
    if string.lower (id) contains \"netscape\"
      return (webBrowser.callBrowser (id, "WWW_OpenURL", s + ",,-1"))

    if string.lower (id) contains "firebird"
      return (webBrowser.callBrowser ("Mozilla Firebird", "WWW_OpenURL", s + ",,-1"))

    return (webBrowser.callBrowser (id, "WWW_OpenURL", s))

If this change is being made by the user, don't forget to click the "Compile" button after making this change.

Once this change has been made, Radio can then successfully use DDE to tell an open Mozilla Firebird window to open a url (like the Desktop Website home page).

Without this change, it is impossible for Radio to communicate with an open Mozilla Firebird browser window. The only apparent option left to the user in this case would be to set Mozilla Firebird's home page to the Desktop Website home page. When Radio starts, the browser would open, and Mozilla Firebird would open the Desktop Website home page on its own - *not* because Radio told it to do so.

Return to Introduction.....

3 Comments

I made it through the first two steps, but I am lost on this third one. How do I find this code in order to insert the two lines? Where is it? Or, how do I find my Radio homepage url when I can't get the page to open in the first place.

I downloaded Firebird yesterday and i loved it yesterday. Today it's making me very queasy....

Thanks for your help. --M

"How do I find this code in order to insert the two lines? Where is it?"

Open the Radio appplication - Choose "Open Radio" from the system tray icon on Windows or from the Dock icon on Mac OS X.

On the Radio app's menu, click "Tools", "Developers", then "Jump...". In the "Enter an address to Jump to" box, enter "webBrowser.openURL" then click the "OK" button. A window will open - this window contains the code you want to change.

"Or, how do I find my Radio homepage url when I can't get the page to open in the first place."

The Radio desktop website homepage URL is http://127.0.0.1:5335/.

Thanks - this was very helpful!!!

About this Entry

This page contains a single entry by TweezerMan published on September 7, 2003 10:38 PM.

Getting Radio to open the Desktop Website in Mozilla Firebird during startup - Part 2 was the previous entry in this blog.

Request for enhancement to radio.macros.imageRef () is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 6.1.2

MT-Vampire plugin

web hosting by TotalChoice Hosting

Valid XHTML 1.0!
Valid CSS!