Closed Bug 865218 Opened 12 years ago Closed 12 years ago

application/x-moz-keywordsearch should still be used in keyword search (nsDefaultURIFixup.cpp)

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 23

People

(Reporter: mkaply, Assigned: mkaply)

Details

Attachments

(3 files, 1 obsolete file)

I understand the concept behind the purpose flag, and it's a good idea, but by removing application/x-moz-keywordsearch it prevents really basic things like having keyword search map to google's "I'm feeling lucky". Not every server can just use a keyword to decide what to do (especially for existing services). It might be a different URL. Looking at the keyword fixup code, there was no reason to remove application/x-moz-keywordsearch. The code in search should have just been changed to not fail if the specific type wasn't found. That way you could support the old code and still have the new code.
This is a simple patch that checks to see if the search engine supports the keyword and if it is there, use it. This allows existing search engines to work. This won't affect the builtin search engines because keyword has been removed.
Attachment #741334 - Flags: review?(gavin.sharp)
Attached file Google Feeling Lucky example (obsolete) —
Assignee: nobody → mozilla
Attachment #741343 - Attachment is obsolete: true
To use this search engine, open scratchpad and type: window.external.AddSearchProvider("https://bug865218.bugzilla.mozilla.org/attachment.cgi?id=741388");
This is a good change. I agreed with Mike's reasoning: I understand the recent change, but it no longer supports certain URL styles. http://mycroftproject.com/ has over 23000 OSDs (!). Some of these are bound to be broken by this changes. If we can support both old and new, that's certainly better.
Any thoughts on this gavin?
I'm kind of on the fence. I guess it's a valid use case, but I hate to have these kind of gross hacks that will likely benefit few people in practice.
Comment on attachment 741334 [details] [diff] [review] Use keyword if available I guess the net cost is relatively low. You can use NS_NAMED_LITERAL_STRING to avoid duplicating the "application/x-moz-keywordsearch" string. Can you document this on https://developer.mozilla.org/en-US/docs/Creating_OpenSearch_plugins_for_Firefox ?
Attachment #741334 - Flags: review?(gavin.sharp) → review+
This is the final patch for check with NS_NAMED_LITERAL_STRING Am I free to check this in at this point?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: