Introduction ŻŻŻŻŻŻŻŻŻŻŻŻ This library was created to make it easier for application programmers to include clickable URLs in their applications, about windows, etc. Current solutions to this problem typically are to launch an ARexx script or just support a few webbrowsers, with no room for configuration. This leads to countless reinventions of the wheel (how many SendURLToBrowser.rexx scripts do you have on your harddisk?). This library solves the problem by giving application programmers a very simple API to handle (one function) and the user gets configurability with the included preferences program. NOTE: I like and use MUI, therefore the included preference program uses MUI. This library is meant to be completely universal though, so programmers preferring other GUI engines are encouraged to program their own preferences editor and send it to me, I'll happily include it. Requirements ŻŻŻŻŻŻŻŻŻŻŻŻ · AmigaOS 2.0 or higher. · MUI 3.8 or higher, for the preference program only. Features ŻŻŻŻŻŻŻŻ · Sends URL by ARexx if your browser is launched, if not, the library will launch the browser. · Configuration supports a list of installed browsers, no Wind*ws "default browser" nonsense. · mailto: URLs can optionally be handled by an email application. · Extremely simple API for applications. · API also available for use from ARexx scripts. · Complete source included for your enjoyment. Installation ŻŻŻŻŻŻŻŻŻŻŻŻ To install the library, handler, prefs and shell-tool do: · backup LIBS:openurl.library, L:OpenURL-Handler, sys:Prefs/OpenURL, C:OpenURL · copy openurl.library LIBS: · copy OpenURL-Handler L: · copy Prefs/OpenURL sys:Prefs/ · copy Prefs/OpenURL.info sys:Prefs/ · copy OpenURL C: Usage ŻŻŻŻŻ Using the preference program should hopefully be very easy. A few tips might be helpful though. The library will try contacting the browsers from top to bottom of the list, so put your favourite browser at the top (drag and drop). The ARexx portname should be set to "BROWSER" even for browsers that call their ports "BROWSER.1", "BROWSER.2", etc. The library will look for any port named "BROWSER.x" where "x" is a number and ".x" is optional. For developers: see autodocs. ToDo ŻŻŻŻ · localize prefs · better whitespace escaping for mailer tags Legal stuff ŻŻŻŻŻŻŻŻŻŻŻ The openurl package is placed in the public domain. We assume no responsibility for what these programs might do, you are using them at your own risk. Authors ŻŻŻŻŻŻŻ Troels Walsted Hansen SnailMail: O.L. Aunesgate 15 9009 Tromsĝ NORWAY Email: troels@thule.no IRC nick: Troels Alfonso Ranieri Email: alforan@tin.it Stefan Kost Email: ensonic@sonicpulse.de Version history ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Libs/openurl.library 1.0 (27.7.98) Prefs/OpenURL 1.0 (27.7.98) C/OpenURL 1.0 (27.7.98) · First release to Aminet. -- OpenURL Release 1.0 -- Libs/openurl.library 1.1 (13.12.98) · Added quotes around formatting codes in the default prefs. · Released together with WebVision 2.0. Libs/openurl.library 2.0 (4.2.99) · Much more efficient searching for browser ARexx ports. · Asynchronous ARexx commandsending through use of new OpenURL-Handler. This prevents apps using OpenURL from locking up if there is for example a crashed browser hanging around in the system. (Ian Kumlien) · Changed the way URLs are sent to browsers. The new scheme works like this: - Search for any started browser, if found, send URL to that. - If not found, start the first browser that is configured with full path. (Suggested by many people) · Added preconfigured path for AWeb and reading of environment variable to get Voyager path. · Added configurable defaults for the various tags supported by URL_Open(). (Marcel Beck) · Added URL_GetDefaultPrefs() function and bumped to V2. · Added a up_Flags field to the prefsstructure, currently only contains a runtime only flag, UPF_ISDEFAULTS. (Marcin Orlowski) · Added the "moreHTML" offline only browser to the default prefs. (Thomas Aglassinger) L/OpenURL-Handler 1.0 (4.2.99) · First release to Aminet. Prefs/OpenURL 2.0 (4.2.99) · Fixed bug that gave hits when prefs-version-unknown requester was displayed. · Added "Project/About..." menuitem (crowd goes wild). (Thomas Aglassinger) · Redesigned and reimplemented half the program to support configurable defaults. The new options enforced splitting the program into a main window and a browser edit window, so the layout wouldn't become big and ugly. · Added "Project/Restore defaults" menuitem. · Added "Information" tab that explains how to configure OpenURL. C/Example 1.1 (4.2.99) · Renamed from OpenURL and removed binary from distribution archive, OpenURL is replaced by a more functional app by Thomas Aglassinger. · Added a linefeed in an errormessage. ;) C/OpenURL 1.1 (4.2.99) · Updated by Thomas Aglassinger to use SmartReadArgs (allows launch from Workbench, for example in project icons) and more functional arguments. -- OpenURL Release 2.0 -- Prefs/OpenURL 3.0 (26.9.99) · New stringgadget preference order is TextInput, BetterString, String. · Automatically opens edit window when adding a new browser to the configuration. (Mario Cattaneo) · Now strips "." extensions from ARexx ports selected in the pop-port gadget. (Mario Cattaneo) · Updated to handle new V3 prefs. · Now uses Popplaceholder.mcc by Marcin Orîowski. · Uses new Popplaceholder.mcc ASL mode. Libs/openurl.library 3.0 (26.9.99) · Added URL_LaunchPrefsApp() function to do just that. · "http://" is now optionally prepended to URLs lacking a scheme. Note that this is a slightly dodgy thing to do, because an URL like "www.thule.no:80" actually looks like a perfectly valid : according to RFC1738 (the dot is a valid character in a scheme). OpenURL will prepend "http://" to such a such a string, it only allows alphanumeric characters, '+' and '-' in schemes. Checking for a hardcoded set of known schemes would be even worse. The moral of the story is: write full URLs, including scheme. (Neil Bothwick) · Added optional special handling for mailto: URLs. It works similarly to the browser support, except the WriteMail ARexx command and the mailer commandline supports a number of placeholders for email address, subject, etc. (Several) · For consistency with the mailto: support, UBNF_URLONCMDLINE is now obsolete, and so is %s as a placeholder for the URL in the OpenURL(W)Cmd templates. %u should be used instead both places. The prefs loader will transparently handle this for old configurations. · Cleaned up UserLibInit a little, there were a couple of memory leaks if the handler failed to load. · Added an ARexx function host at offset -66. To load: IF ~SHOW('L','openurl.library') THEN CALL ADDLIB('openurl.library',3,-66) Functions are: success = OPENURLPREFS() success = OPENURL(URL/A,SHOW/S,NOSHOW/S,TOFRONT/S,NOTOFRONT/S,NEWWIN/S, NONEWWIN/S,LAUNCH/S,NOLAUNCH/S) (Sigbjĝrn Skjĉret) · Quotes around "%u" in default prefs commandlines as well as when converting V2 prefs to V3. · Prefs would be considered defaults even after a save. · Added THOR SendMail.br script by Neil Bothwick to defaults. · Fixed a bug in the argument parsing for the ARexx function OPENURL(). C/Example 1.2 (26.9.99) · Added LAUNCHPREFS switch to test URL_LaunchPrefsApp(). -- OpenURL Release 3.0 -- Libs/openurl.library 3.1 (3.12.01) · openurl.library lost the seg associated with L:OpenURL-handler each time it is inited. The one and only modification is a tag added to CreateNewProcTags() in libraray_api.c -- OpenURL Release 3.1 -- (Alfonso Ranieri ) Prefs/OpenURL 3.2 (31.1.02) · selection of the new new placeholder %p for pubscreen name. Libs/openurl.library 3.2 (31.01.02) · new placeholder %p for pubscreen name. -- OpenURL Release 3.2 -- (Stefan Kost ) Libs/openurl.library 3.3 (07.02.02) · fixed OpenURL commandline tool, PUBSCREEN option is not mandatory · fixed very broken mailto: parsing · Subject & body are broken down correctly · encoded chars in url are decoded · arexx commands are sent sequentially, if required (YAM) => thus you can now do things like : openurl "mailto:ensonic@sonicpulse.de?subject=hi%20hi!&body=new%20openurl%0Ais%20cool" -- OpenURL Release 3.3 -- (Stefan Kost )