VM

Firefox is called using obsolete "-remote openURL(...)" syntax

Bug #1787758 reported by Göran Uddeborg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Committed
High
Uday Reddy

Bug Description

The function vm-mouse-send-url-to-firefox in vm-mouse.el calls Firefox using the format

  firefox -remote openURL(<the-URL>)

That format is obsolete since a long time, and calling it has no effect currently. The correct format nowadays appears to be simply

  firefox <the-URL>

That will use an existing Firefox instance if there is one. If no browser is running, the call will not return, so VM should not wait for it to finish.

This applies to the version 8.1.2 (called "stable", even if "legacy" might be more appropriate), but browsing the source repository it seems it also applies to more recent versions.

Related branches

Revision history for this message
Uday Reddy (reddyuday) wrote :

The current settings work fine for me, using Firefox Quantum 61.0.2. And, it is working irrespective of whether there is a Firefox window already open or not.

What behaviour are you getting?

Changed in vm:
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Göran Uddeborg (goeran-uddeborg) wrote :

It works for you? Now I'm getting confused.

When I click on a link in a plain mail it looks as it should work, and it it says it sent the URL to Mozilla Firefox. But the page never shows up in my browser.

Bringing up the *Messages* buffer, I see it actually printed those messages, even if I only noticed the last one.

    Sending URL to Mozilla Firebird...
    vm-run-command: "firefox" ("-remote" "openURL(https://bugs.launchpad.net/bugs/1787758)")
    Sending URL to Mozilla Firefox... done

(I noticed the incorrect name in the first message has been fixed in later versions of VM.)

The problem only applies to plain mail messages. HTML messages formatted by w3m takes a different path, and works after a confirmation dialog.

Trying the command on the command line also has no effect.

    mimmi$ firefox -remote 'openURL(https://bugs.launchpad.net/bugs/1787758)'
    mimmi$

No error message, but nothing shows up in firefox.

I'm also using Firefox 61.0.2, more precisely the Fedora packaging firefox-61.0.2-1.fc28.x86_64.

Am I doing something wrong?

Revision history for this message
Uday Reddy (reddyuday) wrote :

Actually, the "-remote OpenURL" invocation failed and VM fell back to the standard call. So, perhaps the "-remote" stuff should be removed. Is there a man page for Firefox somewhere?

Revision history for this message
Uday Reddy (reddyuday) wrote :

Ok, the reason it is failing for you is independent of the "-remote" call, because VM tries it both ways, with and without "-remote".

Revision history for this message
Uday Reddy (reddyuday) wrote :

I take that back. I see two invocations in the *Messages* buffer:

  Sending URL to Mozilla Firefox...
  vm-run-command: "C:/Program Files/Mozilla Firefox/firefox.exe" ("-remote" "openURL(https://bugs.launchpad.net/bugs/1787758)")
  Sending URL to Mozilla Firefox...
  vm-run-background-command: "C:/Program Files/Mozilla Firefox/firefox.exe" ("https://bugs.launchpad.net/bugs/1787758")

I suspect that the first call failed for you in such a way that VM couldn't detect it. What is "Firebird"?

Revision history for this message
Göran Uddeborg (goeran-uddeborg) wrote :

I see only the first call. And when I try the command from the command line, it does indeed not give any error message or status code; it fails silently. From your paths I suspect you are running on Windows. I'm running on Linux; maybe there is a small difference in the start scripts.

"Firebird" is how it is written in 8.1.2. (As I mentioned, it is the latest release called "stable".)

  https://bazaar.launchpad.net/~vm/vm/8.1.x/view/head:/lisp/vm-mouse.el#L331

(IIRC "Firebird" was an early name for what is today called "Firefox". The name was changed to avoid conflict with the database Firebird.)

Revision history for this message
Uday Reddy (reddyuday) wrote :

Apparently this is a "bug" in Firefox,
  https://bugs.launchpad.net/ubuntu/+source/emacs24/+bug/1425972
but I have no idea what is being considered the "bug" and how they are fixing it.

I suggest you switch to VM 8.2.0b, and use the "browse-url" menu item. It uses the standard Emacs library to send url's to browsers.

Changed in vm:
status: Incomplete → Invalid
assignee: nobody → Uday Reddy (reddyuday)
Revision history for this message
Göran Uddeborg (goeran-uddeborg) wrote :

I don't think it believe it is considered a bug, it was intentionally removed from what I can tell.

    https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#Remote_Control

I'll take a look at migrating to 8.2.

(But then, if even YOU recommend to use 8.2 for everyday use, then why isn't that the branch labelled stable? It's beta label is what has kept me from switching in this environment.)

Revision history for this message
Uday Reddy (reddyuday) wrote :

Ok, I removed the OpenuRL call to Firefox.

Fix committed in revision 1525.

Changed in vm:
status: Invalid → Fix Committed
milestone: none → 8.2.90a
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.