Closed Bug 229681 Opened 21 years ago Closed 19 years ago

firefox -remote now requests well-formed URLs

Categories

(Core Graveyard :: X-remote, defect)

1.0 Branch
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 242123

People

(Reporter: astralstorm, Assigned: blizzard)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20031229 Firebird/0.7+ (AstralStorm)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20031229 Firebird/0.7+ (AstralStorm)

The change in behaviour is unexpected.
For example, launching
MozillaFirebird -remore "openURL(www.slashdot.com,new-window)"
worked, while now it doesn't and one has to enter
MozillaFirebird -remore "openURL(http://www.slashdot.com,new-window)"

Reproducible: Always

Steps to Reproduce:
Described in details.
Actual Results:  
'Failed to send command'

Expected Results:  
Should open new window and launch the url.
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b)
Gecko/20040331 Firefox/0.8.0+

I'm also finding this in the latest CVS snapshots,

>/usr/lib/MozillaFirefox/firefox -remote "openURL(,new-window)"
Failed to send command.
>/usr/lib/MozillaFirefox/firefox -remote "openURL(http://www.google.com,new-window)"
Failed to send command.
>/usr/lib/MozillaFirefox/firefox -remote
"openURL(http://www.google.com/,new-window)"
(starts up fine, note the trailing slash)

If there's any more information I can provide to be of help, please just ask,
I'm pretty much up for trying anything...
Did some more digging, and I realise this doesn't agree with my original data,
but it seems as though the openURL command requires more than 3 slashes *unless*
there is no space between the comma and the new-window.

So to recap:

firefox -remote "openURL(http://www.google.com, new-window)" does *not* work
firefox -remote "openURL(http://www.google.com,new-window)" *does* work

Looking through the source code
(http://lxr.mozilla.org/seamonkey/source/xpfe/components/xremote/src/XRemoteService.cpp#695),
it seems that the openURL procedure takes its argument and checks to see whether
this is a valid uri or not.  It does this by handing the entire argument to a
checking routine, ie without removing commas or new-window commands, or
anything.  I'm guessing this is *probably* what breaks it.  It could be fixed
fairly easily by moving the check until after it's parsed the arguments from the
end.  I've (hopefully) attached a patch that should fix it...

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040727 Firefox/0.9.1+

WORKSFORME.

Firefox behaves correctly with all of the following commands: 

firefox -remote "openURL(slashdot.com,new-window)"
firefox -remote "openURL(www.slashdot.com,new-window)"
firefox -remote "openURL(http://www.slashdot.com,new-window)"

However, when I enter these commands: 

firefox -remote "openURL(slashdot.com, new-window)"
firefox -remote "openURL(www.slashdot.com, new-window)"
firefox -remote "openURL(http://www.slashdot.com, new-window)"

I get this error:
firefox: line 165: [: too many arguments
firefox: line 165: [: too many arguments
Is this OK now in newer builds of Mozilla Firefox?
Summary: MozillaFirebird -remote now requests well-formed URLs → firefox -remote now requests well-formed URLs
Hello,

I'm using Firefox 1.0 here and I was going to submit a bug about this same thing
when I encountered some problems today.

[FAILED] firefox -a firefox -remote "openURL(www.google.com,new-tab)"
[FAILED] firefox -a firefox -remote "openURL(www.google.com, new-tab)"
[FAILED] firefox -a firefox -remote "openURL(www.google.com/, new-tab)"
[FAILED] firefox -a firefox -remote "openURL(www.google.com/,new-tab)"

[  OK  ] firefox -a firefox -remote "openURL(http://www.google.com,new-tab)"
[  OK  ] firefox -a firefox -remote "openURL(http://www.google.com, new-tab)"
[  OK  ] firefox -a firefox -remote "openURL(http://www.google.com/,new-tab)"
[  OK  ] firefox -a firefox -remote "openURL(http://www.google.com/, new-tab)"

On the other hand, firefox www.google.com works when Firefox is not running. It
would be very nice if Firefox admited www.somesite.com as being a valid argument
for openURL.

At least in my case, the ones that failed didn't even print anything on screen
and returned an exit status of 0.
Moving to Core->X-remote...
Assignee: firefox → blizzard
Component: General → X-remote
Product: Firefox → Core
QA Contact: blizzard
Version: unspecified → 1.0 Branch
Status: UNCONFIRMED → NEW
Ever confirmed: true
this is already fixed (including on the branch)

patch in bug 242123 is identical to the one attached.

*** This bug has been marked as a duplicate of 242123 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: