![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
Clicking on a "mailto" link opens a new tab then automatically closes immediately
When I click on a "mailto" link, Firefox (my default browser) opens a new tab, then immediately close that tab without waiting for my to interact with it. No draft email is created. I see that other users have reported this behavior in the past, and I've tried the suggested remedies without success. Specifically, I ran Malwarebytes, and it found no threats. I then started Firefox (on the Mac) via the Option key (to start it without ad-ons), and that does not change the behavior. I'm on ver 99.0.1 of FF, which is up to date as of 4/20/2022 (today). My Mac OS is also up to date (ver 12.3.1). My Mac is a 2021 MacBookPro with the Apple M1 Pro chip. I use gmail. OTHER BROWSER (like Safari and Chrome) can open "mailto" links in a new tab in FF (which is my default browser, and used for mailto links) just fine! Here is an example of the URL that I see in a new FF tab opened via Chome: https://mail.google.com/mail/u/0/?fs=1&tf=cm&source=mailto&su=Cover+of+the+River+Journal&to=Steve+Mones%3Cstevenmones@optonline.net%3E Any help would be appreciated. - Thanks, Jim
Valgt løsning
Hey Jefferson - Problem solved! Turns out it was an errant javascript that was opening a new window with a mailto URL, and then closing that window 1/2 sec later. The reason it worked cross-browser, was that javascript can not close a window in a different browser! But thank you for thinking about this perplexing behavior, and describing the about:profiles way to get a fresh browsing environment. That will be perfect for websites that do odd things, and I suspect the cache and/or cookies. Since so much useful browser state is stored there, I hate to flush it just to see if a broken website is caused by those things. - Thanks!! Jim
Læs dette svar i sammenhæng 👍 0Alle svar (7)
Hi Jim, I'm trying to understand the strange internal/external dynamics here:
- Internal mailto links on pages in Firefox do not launch a Gmail compose window in Firefox, but
- External mailto links in other application DO successfully launch a Gmail compose tab in Firefox
That's strange, but I have a thought:
Could you change the mailto setting to "Always Ask" so that Firefox displays a popup list of mail handlers when you click a mailto link. This article will get you over to that section of the Settings page:
Change the program used to open email links
So the next time you click a mailto link, Firefox should show a list of available methods to compose a message. Usually Gmail will be one the list as a built-in option. Does that one work?
Hey Jefferson - Thanks for your thoughts on this! I tried your suggestion, and now I always get the popup prompt asking what app I want to use for mailto links, but from within FF that prompt automatically disappears in just under a second, whereas if behaves normally from Safari or Chrome. One clarification about your post, internal (inside FF) mailto links always launch either that "which app" prompt, or a new tab to send mail (when the setting is set to gmail), but both automatically go away in just under a second. I guess that shows it's NOT gmail closing the tab, because your suggestion stop it before gmail gets involved. And it's not caused by an add-on, nor malware that Malwarebytes could detect. I'd uninstall and re-install FF, but I would hate to lose all of the cookies from years and years of browsing. I wonder if there is some kind of debugging output that I could enable to see what's causing the "auto close"? - Jim
Hi Jim, the popup to choose your mail site/program shouldn't close unless something send the Esc key or clicks Cancel.
As a test to distinguish between a settings issue and perhaps some other issue:
New Profile Test
This takes about 3 minutes, plus the time to test a sample mailto link.
Inside Firefox, type or paste about:profiles in the address bar and press Enter/Return to load it.
Take a quick glance at the page and make a mental note of which Profile has this notation: This is the profile in use and it cannot be deleted. That is your current default profile.
Click the "Create a New Profile" button, then click Next. Assign a name like Apr2022, ignore the option to relocate the profile folder, and click the Finish button.
Firefox will switch your default profile to the new one, so click the Set as Default Profile button for your regular one to avoid an unwanted surprise at your next startup.
Scroll down to Apr2022 and click its Launch profile in new browser button.
Firefox should open a new window that looks like a brand new, uncustomized installation. (Your existing Firefox window(s) should not be affected.) Please ignore any tabs enticing you to connect to a Sync account or to activate extensions found on your system to get a clean test.
If you open a page with a mailto link and click it, does that work any better in the new profile?
When you are done with the experiment, you can close the extra window without affecting your regular Firefox profile. (Apr2022 will remain available for future testing.)
Hey Jefferson - wow, you know so much about Firefox! I did the experiment you described, and it did not change the errant behavior with mailto links. When I click on a mailto link, I get the prompt asking which app I'd like to use for mailto links, but that prompt automatically disappears in just under a second. I did notice that the 2nd running instance of FF has none of my bookmarks or cookies.... it's like a fresh install.
Is there some way to uninstall FF, but save and restore my bookmarks and cookies? What appears to be my FF profile?
- Thanks, Jim
Hi Jim, I'm not sure that reinstalling Firefox will make a difference, but since you are on Mac, I'm not sure what to suggest as the next step (I'm a Windows person).
If you want to make a backup of your profile data, see: Back up and restore information in Firefox profiles
One other setting: if you change from "Always ask" to "Use Gmail" I assume you get a tab, but does that tab still close in the test Apr2022 profile?
Valgt løsning
Hey Jefferson - Problem solved! Turns out it was an errant javascript that was opening a new window with a mailto URL, and then closing that window 1/2 sec later. The reason it worked cross-browser, was that javascript can not close a window in a different browser! But thank you for thinking about this perplexing behavior, and describing the about:profiles way to get a fresh browsing environment. That will be perfect for websites that do odd things, and I suspect the cache and/or cookies. Since so much useful browser state is stored there, I hate to flush it just to see if a broken website is caused by those things. - Thanks!! Jim
I don't understand where the errant JavaScript is coming from. It isn't just a normal mailto link like mailto:bob@example.com?