I've written a replacement for "OdysseyLauncher", so that Odyssey can finally be (properly) used with AmigaOS4's URLOpen command. What's the benefit for URLOpen? If Odyssey is already running, then it will NOT run Odyssey again (creating a new window after a long delay), but rather it will send an ARexx message asking Odyssey to open the URL in a new tab.
In other words, it 'fixes' URLOpen to behave like OpenURL! (I should mention that it's not really URLOpen that needed fixing, but rather the OS4 port of Odyssey wasn't written to work correctly with URLOpen.)
It should be put in the same folder as Odyssey, and used instead of Odyssey from now on! So add it to your AmiDock (and afterwards maybe Edit it's Name to just "Odyssey").
To make URLOpen use it, start Sys:Prefs/URL, and for each tab change AppDir:Odyssey to AppDir:OdysseyLauncherPE . Before using URLOpen, make sure you have double-clicked on OdysseyLauncherPE once (so that AppDir knows where to find it).
Currently OdysseyLauncherPE has two switches: UseExistingTab/S, DoNotBringToFront/S
UseExistingTab tells it to open the provided URL in the currently active tab. DoNotBringToFront tells it to not bring Odyssey to the foreground. Where do you put these switches? In the "Commandline Format" column. So for example, if you had this: "*"http://%s*""
Then you can change it to this: "*"http://%s*" UseExistingTab"
Let me know if this works (or not!) for you, and whether it is worth polishing to release on OS4Depot...
P.S. Here is the old discussion which eventually motivated me to write this.
edit: Corrected how to use parameters. Thanks to "colinw" for spotting this!
Edited by ChrisH on 2016/6/30 22:58:45 Edited by ChrisH on 2016/6/30 23:05:17 Edited by ChrisH on 2016/6/30 23:06:42 Edited by ChrisH on 2016/7/3 20:05:29 Edited by ChrisH on 2016/7/3 20:12:50 Edited by ChrisH on 2016/7/17 9:52:29 Edited by ChrisH on 2016/7/18 17:43:18 Edited by ChrisH on 2016/7/18 17:43:57 Edited by ChrisH on 2017/2/26 10:56:40 Edited by ChrisH on 2017/2/26 10:57:52 Edited by ChrisH on 2017/2/27 12:49:16
In other words, it 'fixes' URLOpen to behave like OpenURL! (I should mention that it's not really URLOpen that needed fixing, but rather the OS4 port of Odyssey wasn't written to work correctly with URLOpen.)
In Odyssey i have added support of both and URLOpen and OpenURL. URLOpen are default in os4, so i firstly try to use that, and if that fail by any of reasons, then OpenURL as fallback (also, for those ones who do want OpenURL because of arexx, can then remove URL from devs:dosdrivers and be able to use openurl). That how it done (code grabbed from YAM):
BOOL wentToURL = FALSE;
// try URL: device at first
if(wentToURL == FALSE)
{
char newurl[SIZE_LARGE];
APTR oldWinPtr;
BPTR urlFH;
// enable requesters again
SetProcWindow(oldWinPtr);
}
if(wentToURL == FALSE && OpenURLBase != NULL)
{
// open the URL in a defined web browser and
// let the user decide himself if he wants to see
// it popping up in a new window or not (via OpenURL
// prefs)
D(DBF_UTIL, "trying openurl.library to open URL '%s'", url);
wentToURL = URL_Open((STRPTR)url, URL_NewWindow, newWindow,
TAG_DONE);
}
As for OdysseyLauncher , its just Joerg's binary i grab from his old OWB.
@kas1e It's not clear to me when that URLOpen/OpenURL code would be used by Odyssey, but I think you got what I said back to front: It's not that Odyssey isn't using URLOpen correctly, but rather that Odyssey doesn't behave correctly when used by URLOpen.
Anyway, in the specific case of Odyssey (which takes ages to load on OS4, on a Sam440 anyway) it makes much more sense to put the "fix" in OdysseyLauncher. So no need for you to modify Odyssey itself (unless you wish to bundle my Launcher with Odyssey instead of Joerg's!).
@Severin Thanks for the 'bug' report. Under what situation do you get that? (I haven't noticed it.)
I could hide Odyssey's Shell output, but I was worried that it might hide something important (like say an error message that explained why Odyssey fails to start)...
@kas1e Could you add a port number in the Odyssey toolbar for the next release?? Currently is has "Odyssey:" followed by a description of the currently displayed URL. It could be changed to "Odyssey.1:", "Odyssey.2:" etc.
It's not clear to me when that URLOpen/OpenURL code would be used by Odyssey, but I think you got what I said back to front: It's not that Odyssey isn't using URLOpen correctly, but rather that Odyssey doesn't behave correctly when used by URLOpen.
I would guess that it's used for mailto links and maybe also other non-http(s) protocols which are not supported by the browser?
@Severin Thanks for the 'bug' report. Under what situation do you get that? (I haven't noticed it.)
It happens on startup when odyssey previously exited cleanly and deleted it's session file - privacy settings, delete session at exit.
@kas1e
Is there any chance of getting a major but simple odyssey bug fixed? If you have 'start downloads automatically' enabled it totally bypasses the checks to see if the file already exists and overwrites it so there is no chance to resume failed downloads or change the name.
Against my better judgement, I have (hopefully) made it silently launch Odyssey, but ONLY WHEN it is not supplied with a URL. I hope this is a reasonable compromise?
Secondly, I have reduce the file size by about 1/4.
I'm now also labelling it as "beta", since I've been using it quite a bit, and not seen any problems (nor has anyone else reported anything troubling).
@Severin I don't think we need to worry about being super-short, since the whole idea is to use the URLOpen command with it (and you can always create a Shell "alias" if you want it ultra short).
Mainly I just want to make it easier to configure Sys:Prefs/URL without making a silly typo. Plus it'd be less confusing if it wasn't almost the same name as the original OdysseyLauncher.
edit: Although with only 4 people expressing any interest in this utility, I'm not sure it's worth me worrying about what to call it + all the hassle involved in (writing docs for) an OS4Depot release.
Thank's, works well when launched from command line or from other program like Yam. But if installed into AmiDock, does start only once. If clicked repeatedly, doesn't open a new tab. Probably intended behaviour?
If clicked repeatedly, doesn't open a new tab. Probably intended behaviour?
Yes, this is the intended behaviour. If Odyssey is minimised (or not front-most screen) then it will be opened (and it's screen brought to the front).
I don't really see a use for multiple Odyssey windows, and in fact it's behaviour is arguably buggy. (I have Odyssey set to re-open with all my last used tabs, and it shows the same set of tabs for every window, which is not what I want!)