Closed Bug 340868 Opened 20 years ago Closed 19 years ago

Offer to re-add an autodiscovered engine if user removes it

Categories

(Firefox :: Search, defect, P2)

2.0 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 2

People

(Reporter: pamg.bugs, Assigned: pamg.bugs)

References

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 1 obsolete file)

If you're viewing a page with an autodiscovered <link rel...> OpenSearch engine that you've already added to your searchbox list, you correctly won't be offered the chance to add it to that list (once bug 340122 is fixed). However, if you remove that engine from your list using the search engine manager, you still won't be offered the chance to re-add it, and the UI won't change to show that an autodiscovered engine is available, until you reload the page.
Blocks: 335435
Assignee: nobody → pamg.bugs
I'd appreciate your having a look at this, Gavin. I'll get module owner approval too.
Attachment #225447 - Flags: review?(gavin.sharp)
Flags: blocking-firefox2?
Whiteboard: [swag: 1d]
Attachment #225447 - Attachment is obsolete: true
Attachment #225795 - Flags: review?(gavin.sharp)
Attachment #225447 - Flags: review?(gavin.sharp)
Priority: -- → P2
Would it be terrible for performance to just let the browser keep one array of the available engines, and have rebuildPopupDynamic filter out already-installed ones (by asking the search service) when it shows the popup? That'd make this code a lot simpler, but maybe the xpconnect round-tripping and frequent lookups onpopupshowing isn't such a good idea. Alternatively, maybe the search bar could keep an array of visible engine titles, kept up to date with the engine-removed/added notifications, and then use that in rebuildPopupDynamic to filter the engines added to the popup. That's be cleaner, I think, but maybe I'm missing something.
(In reply to comment #3) > Would it be terrible for performance to just let the browser keep one array of > the available engines, and have rebuildPopupDynamic filter out > already-installed ones (by asking the search service) when it shows the popup? That's a thought. Since it only has to ask about autodetected engines, which aren't common, the performance hit wouldn't be too bad. One or two queries per onpopupshowing, but only for pages with any <link> engines at all. > Alternatively, maybe > the search bar could keep an array of visible engine titles, kept up to date > with the engine-removed/added notifications, and then use that in > rebuildPopupDynamic to filter the engines added to the popup. I'm not sure about the benefit of duplicating the whole list of engine titles. Adding and removing engines won't be common either, but the memory would be used all the time.
(In reply to comment #3) > Would it be terrible for performance to just let the browser keep one array of > the available engines, and have rebuildPopupDynamic filter out > already-installed ones (by asking the search service) when it shows the popup? > That'd make this code a lot simpler [...] I started into this, but I don't think it'll make the code much simpler, if at all. The problem is that the search-button "addengines" attribute needs to be updated so it shows the right UI (a red magnifying glass, currently) depending on whether there are engines available to be added. That means that search.xml still needs to observe engine-added and engine-removed, and re-filter the list on each of those; and updateSearchButton() in browser.js also has to do the same filtering. Given all that, I think it's actually simpler to let the filtering happen when the <link> is detected and only have to update it when its status changes -- that is, to stick with the current patch.
So, does this mean that if I do this: - Remove Google (which is part of the default list that ships with the app) that "Add Google" will show up in the menu?
No, this is only for autodiscovered engines, ones with <link rel...> tags on the current page. It means that if you go to www.technorati.com, add the engine that shows up in the list, then remove it using the Engine Manager, you'll be offered the chance to add it again without having to reload the page.
(In reply to comment #6) > So, does this mean that if I do this: > > - Remove Google (which is part of the default list that ships with the app) > > that "Add Google" will show up in the menu? The case you mention is bug 334486.
Comment on attachment 225795 [details] [diff] [review] Same code, now with more comments r=ben@mozilla.org
Attachment #225795 - Flags: review?(gavin.sharp) → review+
Flags: blocking-firefox2? → blocking-firefox2+
Checked in on trunk to bake before 1.8 branch landing.
Flags: blocking-firefox2+ → blocking-firefox2?
Whiteboard: [swag: 1d]
Attachment #225795 - Flags: approval1.8.1?
Not a blocker, but we'll take the fix.
Flags: blocking-firefox2? → blocking-firefox2-
Attachment #225795 - Flags: approval1.8.1? → approval1.8.1+
fixed-1.8-branch, fixed-on-trunk
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: