How to use SeaMonkey with other profile as protocol handler?

General discussion about web technology.
Post Reply
barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

How to use SeaMonkey with other profile as protocol handler?

Post by barbaz » Sun Sep 28, 2014 6:44 pm

Just switched email client from Thunderbird 2 to SeaMonkey (on Mac OS X), and I need to use separate profiles for browser and email. So I start SeaMonkey mail profile from a shell script with "-no-remote -new-instance".
Part of keeping browser and email profiles separate is that links from emails will need to be opened in the browser profile, creating a new SeaMonkey instance if needed.
I got part way there by disabling mail phishing protection and setting SeaMonkey.app as the external handler for http(s) links, but that opens a stray browser window in the mail profile, and it only works correctly if the first started instance of SeaMonkey is the browser profile (which it won't always be).

So how to always open http(s) links in SeaMonkey with a different profile, no matter what instances are started when?
(If no one here knows, would I be better off to ask on mozillaZine or IRC?)
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: How to use SeaMonkey with other profile as protocol hand

Post by Thrawn » Tue Sep 30, 2014 4:13 am

Sorry, no idea. I haven't used Seamonkey to speak of.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Wed Oct 01, 2014 6:15 pm

(Where's therube? If anyone here knows either the answer or where I would be better off to ask, I'd think he would.)
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

User avatar
therube
Ambassador
Posts: 7469
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to use SeaMonkey with other profile as protocol hand

Post by therube » Wed Oct 01, 2014 7:31 pm

The only "better" place is where you happen to get an answer ;-).

All are good - if someone is around who knows what to suggest.

I'd start with mozillazine, get something written up there.
Then jump to #seamonkey & ask there, pointing to mozillazine if necessary, for further detail or to see existing responses. (It's all going to depend on who's around & who might know.)

I know there have been network network.protocol-handler.external.http suggestions before (by myself, at least) for someone to try, but I don't think anyone's actually responded back as to how or if it worked out.

No sure of the specifics of -new-instance offhand (or even -no-remote, even though I use it regularly).

Seem to recall a report or bug about a blank (SeaMonkey ?) window, perhaps relating to a similar situation.

To be clear, Mail is with -no-remote, & you would otherwise have no other instance of SeaMonkey, or an instance opened without the -no-remote switch. And a link from Mail is also intended to open a Profile, again without a -no-remote switch (as I think that's the only way it would work in any case).


As far as Mail itself, there are a number of issues that cropped up with 2.29.1 that were not in 2.26, just so you know. Likewise some have reverted or are not yet updating to 2.29.1 waiting for those issue to be resolved (with later release).


I'd mess around with this a bit, but at present time is not on my side.
(posting now so i don't loose what i've put down, but may update, some, ... later?)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Wed Oct 01, 2014 9:02 pm

Thanks therube for answering.
Will try mozillaZine later today.

therube wrote:Seem to recall a report or bug about a blank (SeaMonkey ?) window, perhaps relating to a similar situation.

I'm pretty sure it's not a "bug". It is, however, a nuisance.

therube wrote:To be clear, Mail is with -no-remote, & you would otherwise have no other instance of SeaMonkey, or an instance opened without the -no-remote switch. And a link from Mail is also intended to open a Profile, again without a -no-remote switch (as I think that's the only way it would work in any case).

Yes.

therube wrote:As far as Mail itself, there are a number of issues that cropped up with 2.29.1 that were not in 2.26, just so you know. Likewise some have reverted or are not yet updating to 2.29.1 waiting for those issue to be resolved (with later release).

Unfortunately, due to some of the extensions I need, I'm forced to use at least Gecko 30 aka SeaMonkey 2.27a2, so reverting to 2.26.1 isn't an option here.
I did see that 2.29.1 can't import bookmarks from a .json file and it corrupts offline IMAP storage, but I don't think I care atm as I don't store IMAP messages offline and there are quite a few copies of my places.sqlite lying around this computer. Were there any other issues?
If not, or if the other issues don't affect me either, my plan is to stick with 2.29.x until the next major Gecko release, then depending on what the release notes for the next SeaMonkey release say, either self build 2.30, or try to upgrade to a custom build of 2.28 from comm-esr31 since that's where it seems the mailnews fixes are going.
(Don't want anything to do with any of that HTML5 DRM crap. Especially Don't want it in my mail client!!)

(edited to fix typo)
Last edited by barbaz on Wed Oct 01, 2014 11:05 pm, edited 1 time in total.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Wed Oct 01, 2014 9:05 pm

therube wrote:I know there have been network network.protocol-handler.external.http suggestions before (by myself, at least) for someone to try, but I don't think anyone's actually responded back as to how or if it worked out.

It only worked if I started the browser profile *before* the mail profile, but also I ran into a weird issue with this where some links which should normally be opened in the background were getting opened in a browser window asking about the external handler (how else could I explain the spontaneous pop-up browser windows in a profile that blocks everything and I'm sure doesn't have malware?)...
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Wed Oct 01, 2014 11:03 pm

therube wrote:I'd start with mozillazine, get something written up there.

http://forums.mozillazine.org/viewtopic.php?f=40&t=2875763
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

User avatar
therube
Ambassador
Posts: 7469
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to use SeaMonkey with other profile as protocol hand

Post by therube » Thu Oct 02, 2014 2:51 pm

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Sun Oct 05, 2014 4:43 pm

Well, seems no one's answering at mozillaZine, even though people have been around... that's even after I posted this:
After looking into this further, I've concluded that the best approach here is likely going to be to write an extension that intercepts top-level loads in the browser and passes specified kinds of URLs to a specified external application instead of letting them load. However, I have no idea how to invoke SeaMonkey from the extension. If I try to run SeaMonkey (even with -remote "openURL(...)" ) from a terminal or shell script, and if there is already a SeaMonkey instance with the browser profile running, it just aborts with an alert box saying there's already a running SeaMonkey instance.

How can I invoke SeaMonkey from an extension to achieve what I want, if that's possible?

Any ideas about that ^^ ? Should I wait more @ mozillaZine (if so, how long?), or just ask at IRC at this point?
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:37.6) Gecko/25272270 Firefox/37.6 SeaMonkey/8.24.9a1pre

User avatar
therube
Ambassador
Posts: 7469
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to use SeaMonkey with other profile as protocol hand

Post by therube » Mon Oct 06, 2014 2:19 pm

> or just ask at IRC at this point?

Sure, go ahead.
I actually thought you were going to do that (or had) once you put up the initial post on mozillazine.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Sat Oct 11, 2014 8:24 pm

Solved!

Install a second copy of SeaMonkey as /Applications/SeaMonkey2.app, then start Mail with the following shell script:

Code: Select all

#!/bin/ksh
/Applications/SeaMonkey2.app/Contents/MacOS/seamonkey -no-remote -new-instance -P mail

Now set /Applications/SeaMonkey.app as the external handler for http(s) links

That's it!

Thanks to mcsmurf and Mc for the suggestions.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; OpenBSD amd64; rv:29.0) Gecko/20100101 SeaMonkey/2.26.1

User avatar
therube
Ambassador
Posts: 7469
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to use SeaMonkey with other profile as protocol hand

Post by therube » Sun Oct 12, 2014 12:56 pm

(I'll have to read through #seamonkey when I've got time to think. I answered a question on mozillazine that I linked here, maybe I should have linked this to there too. I will, but perhaps not till tomorrow or so.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0 SeaMonkey/2.29.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Sun Oct 12, 2014 4:26 pm

(FWIW I posted the solution in my mozillaZine thread as well, if you would rather link that.)
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; OpenBSD amd64; rv:29.0) Gecko/20100101 SeaMonkey/2.26.1

barbaz
Senior Member
Posts: 9280
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to use SeaMonkey with other profile as protocol hand

Post by barbaz » Fri Aug 28, 2015 6:03 pm

So I've just tried to do this in Linux & the solution that worked for Mac wasn't working & I couldn't figure out why. After some discussion with NeilAway & therube on IRC, we discovered that the -no-remote & -new-instance command line options are respectively setting the MOZ_NO_REMOTE & MOZ_NEW_INSTANCE environment variables on the seamonkey-mail process & all its child processes, thus causing the invocation of the separate SeaMonkey browser to think it has to run as its own sole instance & rejecting other attempts to run or call it.

So to make this work on Linux it's needed to have a wrapper for seamonkey browser that unsets those variables. This ksh script, placed in the same directory as the seamonkey browser binary, seems to work:

Code: Select all

#!/bin/ksh
unset MOZ_NO_REMOTE
unset MOZ_NEW_INSTANCE
"$(dirname $0)/seamonkey" $@

Make it executable & set it as the http & https handler in seamonkey-mail, & at that point it was working for me.


And another tip I discovered along the way, here's how to determine environment variables from SeaMonkey:
Tools > Web Development > Error Console
Type/paste the following:

Code: Select all

Components.classes['@mozilla.org/process/environment;1'].getService(Components.interfaces.nsIEnvironment)

followed by either
  • .get('VAR') to obtain the value of environment variable VAR
  • .exists('VAR') to see if the environment variable VAR is set
*Always* check the changelogs BEFORE updating that important software!
-

Post Reply