Closed Bug 1643973 Opened 4 years ago Closed 4 years ago

Everything in URL bar is selected with single click

Categories

(Firefox :: Address Bar, enhancement)

77 Branch
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1621570

People

(Reporter: maren, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

I clicked into the URL bar.

Actual results:

The whole URL got selected.

I needed to click again to just edit a piece of the URL (a request parameter, or a language snippet). This is a task I need to do multiple times an hour on many days, when I do web development.
When I forget that I need to click again and just start typing, it deletes the whole URL and I need to reload the page to get it back, so I can try to edit it again.

I looked for options, found them in the Support forum, and adjusted them in about:config, and they did not work anymore.

Then I read in this bug tracker that this was an intentional change. I also read that many, many people complained about it, and saw multiple duplicate bug reports that have only been closed, telling people that 'every other browser does it like this, too' and that 'testing is too expensive'.

I'm using Firefox! Not 'every other browser'. Chromium will soon only be available as a snap to me, that's not even a useful option at all. I rely on Firefox. 'Everyone else does it' doesn't seem like a valid argument to me.
People have offered to help test, too. Someone even made a fork just because of this.

The 'main' bug report said that you'd be monitoring the situation, but the report was closed. So I wasn't sure where to give you the opportunity of monitoring, and opened a new report. While duplicates are being closed, the actual issue is not resolved.

Expected results:

Please reintroduce an option that allows it that a user can click into the url bar just like into any normal text field, to edit it painlessly.

The user agent auto-detection just detected what my extension told it. I'm using 77, but Linux MInt is correct.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Address Bar

Then I read in this bug tracker that this was an intentional change.

If you think that you read something somewhere then please always provide references for statements (=full URL). Don't make people guess. Thanks.

Flags: needinfo?(maren)
Flags: needinfo?(maren)
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

I figured out a workaround to this bug that doesn't require re-compiling Firefox!

Firefox's UI javascript code is located in the installation directory in the file browser/omni.ja. This file is just a simple zip file. It is possible to edit the files within this zip file in order to modify Firefox's UI. Re-compiling Firefox is not necessary for the changes to take effect, only a simple restart.

The workaround is simple: extract the file modules/UrlbarInput.jsm from omni.ja, edit the file to remove the clickSelectsAll behavior, and then re-add the edited modules/UrlbarInput.jsm file to omni.ja. The simplest edit I found was to change the first instance of this._preventClickSelectsAll = this.focused; to this._preventClickSelectsAll = true; (currently line 2018 of UrlbarInput.jsm).

Under Ubuntu, the following commands will modify the current Firefox install to remove the URL bar ClickSelectsAll behavior:

cd /tmp
unzip /usr/lib/firefox/browser/omni.ja modules/UrlbarInput.jsm
sed -i 's/this._preventClickSelectsAll = this.focused;/this._preventClickSelectsAll = true;/' modules/UrlbarInput.jsm
sudo zip --update /usr/lib/firefox/browser/omni.ja modules/UrlbarInput.jsm
rm /tmp/modules/UrlbarInput.jsm
rmdir /tmp/modules

Note that you will need to re-run the above commands every time Firefox gets updated by the system in order to re-disable the ClickSelectsAll behavior.

Marco: would you consider re-opening comments on #1621570 in order to allow broader discussion of this workaround?

(In reply to Stephen McCarthy from comment #6)

Marco: would you consider re-opening comments on #1621570 in order to allow broader discussion of this workaround?

Nope, I'm sorry but I feel like unofficial workarounds should be discussed in message boards or communities (Reddit, Matrix or similar), the bug tracker is not the right place for those discussions. Comments were restricted because of too many me-too or advocacy comment causing mail-spam, reopening and commenting there would restate that problem. We use bugzilla for work every day and we get hundreds of emails per day already, I hope that's understandable.

I'm wondering... when there are 'too many me-too' comments on a bug report, shouldn't that trigger reconsideration? This could potentially also reduce the amount of resulting spam ...

(In reply to Stephen McCarthy from comment #6)

I figured out a workaround to this bug that doesn't require re-compiling Firefox!

Firefox's UI javascript code is located in the installation directory in the file browser/omni.ja. This file is just a simple zip file. It is possible to edit the files within this zip file in order to modify Firefox's UI. Re-compiling Firefox is not necessary for the changes to take effect, only a simple restart.

The workaround is simple: extract the file modules/UrlbarInput.jsm from omni.ja, edit the file to remove the clickSelectsAll behavior, and then re-add the edited modules/UrlbarInput.jsm file to omni.ja. The simplest edit I found was to change the first instance of this._preventClickSelectsAll = this.focused; to this._preventClickSelectsAll = true; (currently line 2018 of UrlbarInput.jsm).

Under Ubuntu, the following commands will modify the current Firefox install to remove the URL bar ClickSelectsAll behavior:

cd /tmp
unzip /usr/lib/firefox/browser/omni.ja modules/UrlbarInput.jsm
sed -i 's/this._preventClickSelectsAll = this.focused;/this._preventClickSelectsAll = true;/' modules/UrlbarInput.jsm
sudo zip --update /usr/lib/firefox/browser/omni.ja modules/UrlbarInput.jsm
rm /tmp/modules/UrlbarInput.jsm
rmdir /tmp/modules

Note that you will need to re-run the above commands every time Firefox gets updated by the system in order to re-disable the ClickSelectsAll behavior.

Marco: would you consider re-opening comments on #1621570 in order to allow broader discussion of this workaround?

Thank you, Steven McCarthy, I'll try that!

(In reply to Stephen McCarthy from comment #6)

I figured out a workaround to this bug that doesn't require re-compiling Firefox!

[…]

I’ve written a Super User answer with a modified approach; that worked for me on Arch Linux.

FYI, for linux users, the super user link also has a link, pointing to a git repo in which a script modifies the necessary files. No recompilation is required. I asked user Marco Bonardo [:mak] if he wants to add some link to this information to the main thread concerning this issue (bug id 1621570), since it is valuable information to many users, but so far no reply. Previously I got really pretty distressed/neurotic whenever clicking somewhere in the url bar. With this fix, I can finally calm down again.

Hey, Stephen McCarthy, thank you! I only randomly happened to read this particular bug report, but your post massively reduces my load (I've been recompiling with a trivial patch that adds an option that effectively does the same). I don't know how else I would have come across such an excellent comment.

You need to log in before you can comment on or make changes to this bug.