Open Bug 611162 Opened 10 years ago Updated 5 months ago

allow double-click in url bar to select part of a URL

Categories

(SeaMonkey :: General, defect)

All
Linux
defect
Not set
normal

Tracking

(seamonkey2.43 affected)

Tracking Status
seamonkey2.43 --- affected

People

(Reporter: info, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [gfb][lang=js])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b7pre) Gecko/20101008 Firefox/4.0b7pre SeaMonkey/2.1b1
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b7pre) Gecko/20101008 Firefox/4.0b7pre SeaMonkey/2.1b1

I'm running the SeaMonkey 2.1b1 64-bit contrib build on Kubuntu 10.10 Maverick Linux using a copied Firefox 4.0b7 profile.

I notice double-clicking a URL in the location field (urlbar) selects the entire URL rather than parts of it.  Firefox has a pref browser.urlbar.doubleClickSelectsAll for this, which seems absent from SeaMonkey.  Meanwhile double-clicking with SeaMonkey 2.0.9 on Windows Vista (using a different years-old profile) selects part of the URL.

Reproducible: Always

Steps to Reproduce:
1. Double-click in the location field at the top of this window
2. Visit about:config and search for click
Actual Results:  
Double-click selects the entire URL, and there doesn't seem to be a pref to override this.

Expected Results:  
"Studies show 90% of SM users would prefer double-click for part and triple-click for entire URL" :-) , or add Firefox's browser.urlbar.doubleClickSelectsAll pref.  I can't figure out why the Windows SM 2.0.9 behaves differently.

I reset all the *click* and *urlbar* prefs in about:config to default.

It could be that my SM 2.1b1 is having trouble determining "word" boundaries in the location field.  I notice that pressing Ctrl+left or right arrow in the location field advances to the beginning or end of the field, rather than to the next part of the URL.
Turns out this bug is actually "make stop_at_punctuation=true the default on unix (double-clicking shouldn't select punctuation)"; setting that pref makes double-click select parts of the URL in the url bar (and in other text boxes).  That bug was reported as bug 190615 , which was fixed for Firefox in 2007 but apparently not SeaMonkey.  The workaround is to toggle this pref to true yourself in Linux SeaMonkey's about:config.

Someone could make this bug a dupe of bug 190615 , or make it a dependency if SM users want to add the browser.urlbar.doubleClickSelectsAll pref that Firefox has.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: x86_64 → All
Version: unspecified → Trunk
Whiteboard: [gfb] [good first bug]
(In reply to comment #1)
> Turns out this bug is actually "make stop_at_punctuation=true the default on
> unix (double-clicking shouldn't select punctuation)"; setting that pref
> makes double-click select parts of the URL in the url bar (and in other text
> boxes).  That bug was reported as bug 190615 , which was fixed for Firefox
> in 2007 but apparently not SeaMonkey.  The workaround is to toggle this pref
> to true yourself in Linux SeaMonkey's about:config.
> 
> Someone could make this bug a dupe of bug 190615 , or make it a dependency
> if SM users want to add the browser.urlbar.doubleClickSelectsAll pref that
> Firefox has.

Hii.. I would like to work on this bug. Im a newbie.. so could you guide me on working on this? Thank you :)
Blocks: FF2SM
Depends on: 190615
Hmm, the bug summary suggests that the reporter just wanted to have a way of changing the behavior, not necessarily the default one. That ability is given through the layout.word_select.stop_at_punctuation pref. If that is enough, this bug can be closed WFM.

If however the default should be changed, then I guess we'd have to port bug 190615, which, despite its summary, not only changed the pref default value for Unix, but also introduced the browser.urlbar.doubleClickSelectsAll pref and defaulted it to true for Unix (not Mac).

Vishnu, if you really want to work on this: The task would be to port the changes from the patch attached to bug 190615 to SeaMonkey. The file mapping is as follows:

browser/app/profile/firefox.js -> suite/browser/browser-pref.js
browser/base/content/urlbarBindings.xml -> suite/browser/urlbarBindings.xml

You'll see that the layout.word_select.stop_at_punctuation pref line in browser-pref.js is already within a #ifndef XP_MACOSX #ifdef XP_UNIX block, which means it only applies to Unix but not Mac. As far as that file is concerned, you'd only have to replace layout.word_select.stop_at_punctuation by browser.urlbar.doubleClickSelectsAll. Then layout.word_select.stop_at_punctuation will be true everywhere except for OS/2 (cf. all.js).
Hi Jens Hatlak, as Vishnu did not update on this issue, i would like to work. Already completed SeaMonkey build. I got a clear picture of what should be done from your comments.

My understanding is,
1) change the default value of layout.word_select.stop_at_punctuation to true
2) Add a new pref item "browser.urlbar.doubleClickSelectsAll"(applies only to unix) and set default value to true

Please correct me if i am wrong.
(In reply to yesyayen from comment #5)
> My understanding is,
> 1) change the default value of layout.word_select.stop_at_punctuation to true

No, this would have implications beyond the location bar (e.g. text boxes in forms), which is why the Firefox developers invented browser.urlbar.doubleClickSelectsAll in the first place.

> 2) Add a new pref item "browser.urlbar.doubleClickSelectsAll"(applies only
> to unix) and set default value to true

No,
1. Introduce new pref browser.urlbar.doubleClickSelectsAll, set it to true for UNIX_BUT_NOT_MAC, else set it to false
2. Port the urlbarBindings.xml changes from bug 190615 (cf. https://bugzilla.mozilla.org/attachment.cgi?id=273341&action=diff)
(In reply to Jens Hatlak from comment #6)
> (In reply to yesyayen from comment #5)
> > 2) Add a new pref item "browser.urlbar.doubleClickSelectsAll"(applies only
> > to unix) and set default value to true
> 
> No,
> 1. Introduce new pref browser.urlbar.doubleClickSelectsAll, set it to true
> for UNIX_BUT_NOT_MAC, else set it to false

Or more simply just add the pref in both places in browser-prefs.js next to the existing clickSelectsAll pref.
Thanks for the explanation.

For SeaMonkey, ClickSelectsAll is not handled in urlbarBindings.xml
ClickSelectsAll, "nsPref:changed" etc are handled at navigator.js
So i should be adding doubleClickSelectsAll code in navigator.js file and not in urlbarBindings.xml right?
(In reply to Anandh from comment #8)
> For SeaMonkey, ClickSelectsAll is not handled in urlbarBindings.xml
> ClickSelectsAll, "nsPref:changed" etc are handled at navigator.js
> So i should be adding doubleClickSelectsAll code in navigator.js file and
> not in urlbarBindings.xml right?

Yes please. You can probably add an extra ondblclick handler to navigator.xul to avoid having to check the event detail.
Defaulting browser.urlbar.doubleClickSelectsAll to true (at least on Linux) would be greatly appreciated. With the release of Firefox Developer Edition, I'm trying it out, and this is a bigger annoyance than it should be. Fortunately it's an easy preference change once you know about it.
NOT reproducible with EN-US SeaMonkey 2.33.1 (German Language pack)  Gecko/20100101 Build 20150321194901 (Default Theme) on German WIN7 64bit:

Try some double clicks into URL of this bug <https://bugzilla.mozilla.org/show_bug.cgi?id=611162> on "https", "bugzilla", "mozilla" and so on. Second click will select the clicked string between punctuation marks.

So indeed Linux only?
Whiteboard: [gfb] [good first bug] → [good first bug]
Mentor: philip.chee
Whiteboard: [good first bug] → [good first bug][gfb][lang=js]
This SeaMonkey bug might belong in "Location bar" or in "UI Design", I'm not sure.

(In reply to bradley.will from comment #10)
> Defaulting browser.urlbar.doubleClickSelectsAll to true (at least on Linux)
> would be greatly appreciated. With the release of Firefox Developer Edition,
> I'm trying it out, and this is a bigger annoyance than it should be.
> Fortunately it's an easy preference change once you know about it.

Another possibility would be (by analogy with xterm, konsole, etc.) to select one word by double-click and the whole line by triple-click. Similarly, when clicking in comment #11 out of a link, a double click selects one word and a triple click selects the whole wrapped line (a "paragraph" if you will). Or at least that's what they do here in this nightly; not sure if it was built with GTK2 or GTK3.

(In reply to Rainer Bielefeld from comment #11)
> 
> So indeed Linux only?

Well, here on SeaMonkey 2.44a1 for Linux64, double-clicking the URL bar selects the whole URL, just like hitting Ctrl+L. And there is no browser.urlbar.doubleClickSelectsAll pref in my about:config; indeed there is nothing between browser.urlbar.clickSelectsAll (which is at its default i.e. false) and browser.urlbar.filter.javascript (which is at its default i.e. true).
Hi Philip! I would like to take this up. Can you please assign it to me and help me get started?
Flags: needinfo?(philip.chee)
Aman,

just start and add a patch when you think you have something usable or add a work-in-progress patch when you need advice.

https://dxr.mozilla.org/comm-central/search?q=ClickSelectsAll&redirect=false

Code handling it in Firefox seems to be in urlbarBindings.xml. For SeaMonkey its navigator.js. 

Neil suggested adding a ondblclick handler to suite\browser\navigator.xul.
Probably here around line 290 where the handler for the single click is located: 

https://dxr.mozilla.org/comm-central/source/suite/browser/navigator.xul#290
Flags: needinfo?(philip.chee)
Attached patch temp_patch.patchSplinter Review
Hi! I have changed a few things in 'browser-prefs.js'. Unable to understand what is needed to be done in 'navigator.js' and 'navigator.xul'. Thanks!
Attachment #8830682 - Flags: review?(frgrahl)
> Unable to understand what is needed to be done in 'navigator.js' and 'navigator.xul'. Thanks!

SeaMonkey needs to handle the doubleclick action in the location bar. Please see comment 6 and 9:

https://bugzilla.mozilla.org/show_bug.cgi?id=611162#c6
https://bugzilla.mozilla.org/show_bug.cgi?id=611162#c9

Did you compile SeaMonkey to test your changes out? I suggest you try them on comm-aurora first and when they work do a patch against comm-central. comm-central breaks a lot these days.
Comment on attachment 8830682 [details] [diff] [review]
temp_patch.patch

You added the browser.urlbar.doubleClickSelectsAll twice:

> +#ifdef UNIX_BUT_NOT_MAC
> +pref("browser.urlbar.doubleClickSelectsAll", true);
> +#else
> +pref("browser.urlbar.doubleClickSelectsAll", false);
> +#endif

> +pref("browser.urlbar.doubleClickSelectsAll", false);
Attachment #8830682 - Flags: review?(frgrahl) → feedback-
I am brand new to open source. I would be interested in trying to fix this bug. Can I work on this?
Gauri, sure. It seems Aman is no longer active here. If you need help setting up a dev environment just send me an email. I suggest you fix it on comm-esr52 first and transplat the change to comm-central later. comm-beta is ok for now but comm-central needs some critical fixes which are mostly now in review before SeaMonkey is usable there.

Hello, I am new to open source and I would like to work on this bug. Can I proceed with it?

(In reply to rohmetradhananjay from comment #20)
Please proceed as per https://wiki.mozilla.org/SeaMonkey/FAQ#How_To_Start_Contributing_Code

May be you can work together with khyati.agarwalss@gmail.com, who currently does her first steps in the SeaMonkey project in Bug 1242241

Keywords: good-first-bug
Whiteboard: [good first bug][gfb][lang=js] → [gfb][lang=js]

Hello, I'd like to try my hand at this if no one is taking it up?

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