Closed
Bug 340604
Opened 19 years ago
Closed 11 years ago
Implement IE's window.external.IsSearchProviderInstalled (New JS API to allow sites to tell whether their engines are already in the list)
Categories
(Firefox :: Search, enhancement)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: pamg.bugs, Unassigned)
References
()
Details
Attachments
(2 files, 1 obsolete file)
12.23 KB,
patch
|
Details | Diff | Splinter Review | |
483 bytes,
text/html
|
Details |
In addition to the JS API to let a page ask to be added to the list of available search engines (see bug 337780), we should provide a way for sites to tell whether they're already in that list, so they can choose not to show the UI (e.g., a button) for adding themselves.
Since we'll only want to let sites ask about their own engines, we'll need to be able to identify an engine by something more secure than its title (see bug 335012).
Reporter | ||
Comment 1•19 years ago
|
||
Sorry, second reference in comment #1 should be to bug 335102, not 335012.
Severity: normal → enhancement
Flags: blocking-firefox2?
Whiteboard: [swag: 1d] after blocking bug gets fixed
Target Milestone: Firefox 2 → Firefox 2 beta1
Comment 2•19 years ago
|
||
plussing for now, but its lowest-priority of the search bugs I've read thus far.
Flags: blocking-firefox2? → blocking-firefox2+
Reporter | ||
Updated•19 years ago
|
Reporter | ||
Updated•19 years ago
|
Priority: -- → P4
Comment 3•19 years ago
|
||
since bug 340331 is wontfixed, minusing this
Flags: blocking-firefox2+ → blocking-firefox2-
Reporter | ||
Comment 4•19 years ago
|
||
It should still be possible to add this API without too much work, but IMO it's not a high priority and shouldn't block. Unless anyone disagrees, I'll leave it at P4, which means it likely won't make it in.
Reporter | ||
Comment 5•19 years ago
|
||
Here's a work-in-progress patch. Other than review, it mostly needs a check to ensure that a site can only ask whether its own search engine is already installed. Some discussion about how strict that should be and how it should be implemented would be welcomed.
I'm inclined to think that you can ask about any site that you could write a cookie for. That's at least a defensible line to draw, but is it too restrictive? Alternatively, we could require that the hostname of the calling page exactly match the hostname of the engine description file; that would certainly be easier to implement, but it seems rather limiting.
Reporter | ||
Updated•19 years ago
|
Whiteboard: [swag: 1d] after blocking bug gets fixed → [swag: 1d]
Reporter | ||
Updated•19 years ago
|
Priority: P4 → P2
Target Milestone: Firefox 2 beta1 → Firefox 2 beta2
Comment 6•19 years ago
|
||
I'm somewhat skeptical about whether this is really needed - the "don't want to add UI to the page unnecessarily" use-case doesn't seem particularly important to me, given that most sites are in my opinion more likely to use auto discovery than in-page UI. It seems like the cost/benefit ratio for implementing this feature (especially securely) is rather high (the cost being code size/complexity).
Are there use cases I'm not considering?
Reporter | ||
Comment 7•19 years ago
|
||
(In reply to comment #6)
> I'm somewhat skeptical about whether this is really needed - the "don't want to
> add UI to the page unnecessarily" use-case doesn't seem particularly important
> to me, given that most sites are in my opinion more likely to use auto
> discovery than in-page UI.
Interesting. I'd guess that most sites will want to show a more prominent "advertisement" than autodiscovery offers.
> It seems like the cost/benefit ratio for
> implementing this feature (especially securely) is rather high (the cost being
> code size/complexity).
I'm also not sure of the magnitude of the benefit, but the cost doesn't strike me as particularly high either.
On the branch, this patch implements the feature with essentially the same security that cookies have -- admittedly not as secure as we'd like them to be, but nothing new. On the trunk, it can use the new domain service, which should be an easy, strong test. (The biggest remaining hole I can see is our inability to know for sure the URL of the page that called the JS function.)
> Are there use cases I'm not considering?
Well, there's some benefit in making our search-engine API as convenient and flexible as possible, to underline the fact that Firefox wants searching to be open and useful. That's not a strong argument, and I wouldn't use it to support a bad change, but for something relatively simple like this it's at least a small point in favor.
Attachment #228757 -
Attachment is obsolete: true
Attachment #229190 -
Flags: review?(mconnor)
Comment 8•19 years ago
|
||
It's nearly impossible to implement this correctly without making changes to how we get the "current URI". This testcase shows an example that gets around the patch's security. I think that a proper solution to bug 334875 is required to implement this correctly.
Comment 9•19 years ago
|
||
I just realized that running the testcase from Bugzilla will of course work for both cases, since it uses addons.mozilla.org as an example, which is also mozilla.org, but I think you get the point :)
Reporter | ||
Comment 10•19 years ago
|
||
Comment on attachment 229190 [details] [diff] [review]
Fixes issue, including cookie-like security
(In reply to comment #8)
> It's nearly impossible to implement this correctly without making changes to
> how we get the "current URI".
True enough.
Attachment #229190 -
Flags: review?(mconnor)
Reporter | ||
Updated•18 years ago
|
Priority: P2 → --
Comment 11•18 years ago
|
||
Renominating, IE has this and I wouldn't be surprised if the following becomes a common script:
if (!window.external.IsSearchProviderInstalled(...))
window.AddSearchProvider(...);
Flags: blocking-firefox2- → blocking-firefox2?
Summary: New JS API to allow sites to tell whether their engines are already in the list → Implement IE's window.external.IsSearchProviderInstalled (New JS API to allow sites to tell whether their engines are already in the list)
Whiteboard: [swag: 1d] → http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/issearchproviderinstalled.asp
Updated•18 years ago
|
Whiteboard: http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/issearchproviderinstalled.asp
Updated•18 years ago
|
Target Milestone: Firefox 2 beta2 → Firefox 2
Comment 12•18 years ago
|
||
(In reply to comment #11)
> Renominating, IE has this and I wouldn't be surprised if the following becomes
> a common script:
>
> if (!window.external.IsSearchProviderInstalled(...))
> window.AddSearchProvider(...);
I think a new bug should be filed on stubbing this out and always returning false, which is all that we can really do in the Firefox 2 timeframe, so that this bug can be kept for the actual implementation (which is what the attached patch does, minus the security issues).
Reporter | ||
Comment 13•18 years ago
|
||
(In reply to comment #12)
> I think a new bug should be filed on stubbing this out and always returning
> false
I'm not certain which is worse for site designers, having the function not exist or having it not do anything useful.
Comment 14•18 years ago
|
||
Not blocking on this, but we will go with gavin's suggestion in comment 12.
filed Bug 351857 to track that for Fx2
Flags: blocking-firefox2? → blocking-firefox2-
Comment 15•18 years ago
|
||
(In reply to comment #13)
> I'm not certain which is worse for site designers, having the function not
> exist or having it not do anything useful.
The point is that having it throw unexpectedly (which is what currently happens, because it doesn't exist) is worse than either of those.
Reporter | ||
Comment 16•18 years ago
|
||
Is it? If we put in a stub, and site designers use it to decide whether to show some intrusive, presumably-one-time-only "Do you want to add us to your menu?" splash, then we've made their site unusable for our users -- and the designers will have to notice that and create two code paths to support us. If we don't put in a stub, and we throw, they'll still need two code paths, but at least it'll be immediately obvious.
Reporter | ||
Updated•18 years ago
|
Assignee: pamg.bugs → nobody
Target Milestone: Firefox 2 → Firefox 3
Comment 17•16 years ago
|
||
Hi, it has been over two years now, and as far as I can tell this still isn't implemented in Firefox 3. Any chance it can get in? I am a site owner wanting to use for the above use case, i.e. to decide whether to show a link to add to the search bar.
Updated•15 years ago
|
Target Milestone: Firefox 3 → ---
Comment 19•13 years ago
|
||
Hi, any news about implementation of this api?
Comment 20•11 years ago
|
||
This was apparently deprecated in Windows 8, per http://msdn.microsoft.com/en-us/library/aa342526(v=vs.85).aspx, so we shouldn't go any further here.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•