Closed Bug 658242 Opened 13 years ago Closed 13 years ago

Search in bookmarks doesn't find javascript: bookmarks

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: bzbarsky, Assigned: mak)

References

Details

(Keywords: regression, Whiteboard: [places-next-wanted])

Attachments

(1 file, 2 obsolete files)

BUILD: 2011-05-19 nightly

STEPS TO REPRODUCE:
1)  Start with a new profile.
2)  Bookmarks > Show All Bookmarks
3)  Select "Unsorted Bookmarks"
4)  Context-click the right-hand pane, select "New Bookmark..."
5)  Type "Pushlog range" for the name.
6)  Type "javascript:foopy" for the location.
7)  Click in the search field at top right
8)  Type "range"
9)  Select the "Unsorted Bookmarks" button for "Search In"

ACTUAL RESULTS: Bookmark created in steps 4-6 not found.

EXPECTED RESULTS: Bookmark found

ADDITIONAL NOTES: I tried some other schemes: "http", "data", "javascrip" (missing 't').  All of those work.
Interesting, if I search "javascript:" it appears.
I think this breaks a common use of bookmarklets and search, so giving it some priority.
Whiteboard: [places-next-wanted]
Regression window(m-c hourly):
Works:
http://hg.mozilla.org/mozilla-central/rev/2e5e4197b9db
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a1) Gecko/20110418 Firefox/6.0a1 ID:20110418013520
Fails:
http://hg.mozilla.org/mozilla-central/rev/202537779786
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a1) Gecko/20110418 Firefox/6.0a1 ID:20110418054324
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2e5e4197b9db&tochange=202537779786
Hrm.  The frecency changes somehow?
yes, that bug touched searches code. Thanks.
Blocks: 630225
Keywords: regression
Assignee: nobody → mak77
OS: Mac OS X → All
Hardware: x86 → All
I thought we did this deliberately...
no, what we did is not storing javascript: in history, not bookmarks.
well, while cooking I rethought to what you said about we did this deliberately, actually you were half right.
Among other changes, I made the searches reuse a part of the locationbar search code, and in the locationbar we don't match on javascript: uris, unless you type "javascript:". This is exactly what happens!
I guess I should just add a param to AUTOCOMPLETE_MATCH to tell if it should skip javascript: uris or not.
Attached patch patch v1.0 (obsolete) — Splinter Review
I'm not 100% sure about naming of the argument but I don't have better ideas (actually I'd love if the behavior would be better configurable and I'd not need to add an argument :\).
Attachment #533933 - Flags: review?(sdwilsh)
bah I didn't add the test to the diff
Attached patch patch v1.1 (obsolete) — Splinter Review
Attachment #533933 - Attachment is obsolete: true
Attachment #533933 - Flags: review?(sdwilsh)
Attachment #533939 - Flags: review?(sdwilsh)
Flags: in-testsuite?
I'm a bit concerned about this because I know there are add-ons out there that use this SQL method now.  Can we fix this without changing that?
Comment on attachment 533939 [details] [diff] [review]
patch v1.1

Yeah, I suppose it would be better to evaluate a non-breaking approach, but I didn't have time to think about it yet. Clearing review request since I share your concern.

For now a simple workaround is to search for "javascript:", this should return all existing bookmarklets.
Attachment #533939 - Flags: review?(sdwilsh)
Attached patch patch v2.0Splinter Review
This is an alternative approach that doesn't touch the interface, apart adding a constant, that is allowed without uuid changes.
It introduces a MATCH_ANYWHERE_UNMODIFIED that acts on pure underlying data skipping any transformation of it.
Thoughts?
Attachment #533939 - Attachment is obsolete: true
Attachment #542785 - Flags: review?(sdwilsh)
Attachment #542785 - Flags: review?(sdwilsh) → review?(dietrich)
Comment on attachment 542785 [details] [diff] [review]
patch v2.0

Review of attachment 542785 [details] [diff] [review]:
-----------------------------------------------------------------

looks a-ok, r=me.
Attachment #542785 - Flags: review?(dietrich) → review+
http://hg.mozilla.org/mozilla-central/rev/bb92a1746f59
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Blocks: 661767
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: