Last Comment Bug 862147 - drop support for window.sidebar
: drop support for window.sidebar
Status: NEW
: dev-doc-needed, leave-open, site-compat
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: stdglobal 862148
  Show dependency treegraph
 
Reported: 2013-04-15 17:33 PDT by :Gavin Sharp [email: gavin@gavinsharp.com]
Modified: 2015-10-30 19:49 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (3.69 KB, patch)
2015-09-21 10:28 PDT, Florian Quèze [:florian] [:flo]
no flags Details | Diff | Review
Instrument usage of window.sidebar.addSearchEngine (2.05 KB, patch)
2015-09-22 06:38 PDT, Florian Quèze [:florian] [:flo]
nfroyd: review+
Details | Diff | Review

Description :Gavin Sharp [email: gavin@gavinsharp.com] 2013-04-15 17:33:10 PDT
It's not specced, and has very little use these days now that window.external.AddSearchProvider exists and is supported across browsers.

I'm not sure what the compatibility impact of this will be, if any.
Comment 1 Olli Pettay [:smaug] 2013-04-16 02:30:18 PDT
Could we add some telemetry for this before removing?
Perhaps compare usage of addSeachProvider to usage of addSearchEngine. (I guess both are used very rarely)
Comment 2 Seb A 2013-08-12 05:32:24 PDT
We are using window.sidebar, and window.sidebar.addPanel for the 'install' into the user's bookmarks.  FYI, Internet Explorer and Opera also have sidebar support.  Not sure about Chrome.  Please do not remove window.sidebar!

We are looking at your Social API, but it would presumably mean having to have very different code for different browsers as they do not support it?  This would make development of our service much harder.
Comment 3 Kohei Yoshino [:kohei] 2013-08-12 06:11:24 PDT
You *can* still utilize the Firefox sidebar by creating an extension:
https://developer.mozilla.org/en-US/docs/Creating_a_Firefox_sidebar

I should mention that (and Social API) in the site compatibility document, BTW.
Comment 4 Seb A 2013-08-12 06:25:25 PDT
Yes, but creating our own extension is more development for us, more maintenance to keep up with Firefox changes, and possibly harder to get customers to install.  I did actually read that document on Friday, and download the "empty sidebar project".  However, the "empty sidebar project" was not compatible with Firefox 23.0.  I tried overriding the max version and it still would not install.  I probably could have fixed it with some more effort, but presumably the "Creating a Firefox sidebar" document is also somewhat out-of-date and I would need to merge in changes to add-on requirements that have been made since that document was written.  It would also be nice not to need a restart.  It is not clear if this example requires a restart since it was written before that functionality was introduced.
Comment 5 Kohei Yoshino [:kohei] 2013-08-12 06:43:08 PDT
The document might be obsolete... but for Firefox 4 and above, extensions are usually maintenance free. And for Internet Explorer, you have to develop an add-on anyway, right?
Comment 6 Kohei Yoshino [:kohei] 2013-08-12 06:58:48 PDT
I'll update the doc and sample extension later today.
Comment 7 Seb A 2013-08-12 10:18:49 PDT
The Internet Explorer sidebar is a form of registry controlled ActiveX control that comes with IE.  We did not really have to develop an add-on.  We just ask users to run a .reg file to 'install' and a different one to 'uninstall'.  Not ideal perhaps, but they can save the .reg file and check it over before running. It is only a few lines. Ref: http://msdn.microsoft.com/en-us/library/aa753590%28v=vs.85%29.aspx

Thanks Kohei, that would be useful.
Comment 8 Kohei Yoshino [:kohei] 2013-08-15 00:43:46 PDT
Here we go: https://github.com/kyoshino/simple-sidebar
It's *restartless* and compatible with Firefox 17+. I'll update the docs soon.
Comment 9 Seb A 2013-08-19 08:15:42 PDT
Thanks Kohei.  Looks good, except I don't see how to access it via the menu.  I see you have a menu-label, etc., but if I press Alt to show the menu, I still can't see it anywhere.  Also, I would like a way for the user to be able to open the sidebar easily without having to remember a hotkey, probably a toolbar button.  Should I basically follow the instructions in https://developer.mozilla.org/en-US/docs/Code_snippets/Toolbar and the two tutorials it links to?
Comment 10 Kohei Yoshino [:kohei] 2013-08-19 15:42:00 PDT
The menu is available under View > Sidebar. And yes, a toolbar button would be helpful for convenient access to the sidebar. I'll update my sample extension.

By the way, I think the Social API is much easier to implement. Though I haven't looked into the API yet and the documentation is not ready, sites using this API don't have to be social services.
Comment 11 Masatoshi Kimura [:emk] 2013-09-15 13:05:05 PDT
(In reply to Seb A from comment #2)
> FYI, Internet Explorer and Opera also have
> sidebar support.

At least Internet Explorer 11 dropped the support in IE 11 mode. Opera (Presto) died.

> Not sure about Chrome.

Chrome (Blink) doesn't support window.sidebar.
Comment 12 Masatoshi Kimura [:emk] 2013-09-16 19:23:06 PDT
(In reply to Masatoshi Kimura [:emk] from comment #11)
> At least Internet Explorer 11 dropped the support in IE 11 mode. Opera

Even IE6 doesn't support window.sidebar. Even if we support the sidebar feature, we shouldn't expose it to content.
Comment 13 Masatoshi Kimura [:emk] 2013-09-30 20:51:10 PDT
(In reply to Seb A from comment #2)
> We are using window.sidebar, and window.sidebar.addPanel

Also, windows.sidebar.addPanel was already removed.
Comment 14 Seb A 2013-10-01 01:56:45 PDT
(In reply to Masatoshi Kimura [:emk] from comment #12)
> (In reply to Masatoshi Kimura [:emk] from comment #11)
> > At least Internet Explorer 11 dropped the support in IE 11 mode. Opera
> 
> Even IE6 doesn't support window.sidebar. Even if we support the sidebar
> feature, we shouldn't expose it to content.

Sorry, but you are wrong. IE6 *does* support the equivalent to window.sidebar (http://msdn.microsoft.com/en-us/library/aa753590%28v=vs.85%29.aspx)!  So does IE7, IE8, IE9, IE10, and probably IE11 at least in Desktop mode (maybe not in Metro mode) although I haven't had a chance to test it yet. And why should we not expose it to content?
Comment 15 Seb A 2013-10-01 01:58:54 PDT
(In reply to Masatoshi Kimura [:emk] from comment #13)
> (In reply to Seb A from comment #2)
> > We are using window.sidebar, and window.sidebar.addPanel
> 
> Also, windows.sidebar.addPanel was already removed.

Yes, I know and it broke our installation procedure and I already wrote on that bug report when that version of Firefox was released.  However, that is not a reason to remove the feature entirely.
Comment 16 Masatoshi Kimura [:emk] 2013-10-01 02:01:18 PDT
(In reply to Seb A from comment #14)
> IE6 *does* support the equivalent to
> window.sidebar
> (http://msdn.microsoft.com/en-us/library/aa753590%28v=vs.85%29.aspx)!

Is it exposed to Web pages? If not, I don't think it's equivalent to window.sidebar. Rather, it would be equivalent to the chrome-only sidebar API.
Comment 17 Masatoshi Kimura [:emk] 2013-10-01 02:08:01 PDT
(In reply to Seb A from comment #15)
> (In reply to Masatoshi Kimura [:emk] from comment #13)
> Yes, I know and it broke our installation procedure and I already wrote on
> that bug report when that version of Firefox was released.

Bug number please? (I searched Bugzilla, but bug 686441 was the only bug you filed.)

> However, that is
> not a reason to remove the feature entirely.

Why? The only remaining function is addSearchEngine which has a standard alternative (window.external.AddSearchProvider).
Comment 18 Seb A 2013-10-01 02:13:20 PDT
(In reply to Masatoshi Kimura [:emk] from comment #16)
> (In reply to Seb A from comment #14)
> > IE6 *does* support the equivalent to
> > window.sidebar
> > (http://msdn.microsoft.com/en-us/library/aa753590%28v=vs.85%29.aspx)!
> 
> Is it exposed to Web pages? If not, I don't think it's equivalent to
> window.sidebar. Rather, it would be equivalent to the chrome-only sidebar
> API.

I'm not certain.  I didn't realise that Firefox window.sidebar was exposed to web pages.  Do you mean that abitrary web pages can modify the contents of the window.sidebar?
Comment 19 Seb A 2013-10-01 02:18:59 PDT
(In reply to Masatoshi Kimura [:emk] from comment #17)
> (In reply to Seb A from comment #15)
> > (In reply to Masatoshi Kimura [:emk] from comment #13)
> > Yes, I know and it broke our installation procedure and I already wrote on
> > that bug report when that version of Firefox was released.
> 
> Bug number please?

bug 691647.  Most of the conversation has been here though because I didn't fancy my chances on getting that reversed after it was released.

> > However, that is
> > not a reason to remove the feature entirely.
> 
> Why? The only remaining function is addSearchEngine which has a standard
> alternative (window.external.AddSearchProvider).

That's incorrect.  It is also available via the GUI (see http://www.syntec.co.uk/agentinstall/).  This is our current work-around for installing the sidebar for our users (after window.sidebar.addPanel was removed) so please don't remove that either!
Comment 20 Seb A 2013-10-01 02:52:25 PDT
(In reply to Kohei Yoshino [:kohei] from comment #10)
> The menu is available under View > Sidebar. And yes, a toolbar button would
> be helpful for convenient access to the sidebar. I'll update my sample
> extension.

Thanks, I had lost it.  And, thanks, that would be good.

> By the way, I think the Social API is much easier to implement. Though I
> haven't looked into the API yet and the documentation is not ready, sites
> using this API don't have to be social services.

The features look nice: however, the Social API is Firefox only.  This means that we would either have to ask all our clients to use Firefox (which we have been doing anyway, but sometimes you get resistance in large organizations), or we would need to fork our code completely depending on the browser.  The advantage of the sidebar approach is that: OK, the installation methods may be different for different browsers, but after that the same code runs in all the browsers as it is standard HTML and Javascript without non-standard API calls.
Comment 21 Florian Quèze [:florian] [:flo] 2015-09-21 10:28:19 PDT
Created attachment 8663755 [details] [diff] [review]
Patch

I have a patch removing window.sidebar.addSearchEngine attached to bug 862148.

This patch removes what remains of window.sidebar.
Comment 22 Seb A 2015-09-21 10:43:28 PDT
Thanks, but no thanks flo. This is still a useful feature that we are actively using.
Comment 23 Olli Pettay [:smaug] 2015-09-21 12:07:18 PDT
Do we have any data how often window.sidebar is used, or even just accessed? 
Remember, removing silly things like navigator.taintEnabled() may cause major breakage.
(navigator.taintEnabled() does nothing! bug 679971)

So, at least we need some telemetry here. Since bug 968923 we have now rather easy way to track
this kind of stuff.
IRC: froydnj: add a line in http://mxr.mozilla.org/mozilla-central/source/dom/base/UseCounters.conf#5 and a [UseCounter] annotation in the appropriate .webidl
Comment 24 Olli Pettay [:smaug] 2015-09-21 12:17:16 PDT
Comment on attachment 8663755 [details] [diff] [review]
Patch

So, I'd rather review this after we have some telemetry.
window.sidebar is ancient stuff so I wouldn't be surprised if the usage is higher than we'd hope.
Comment 26 Florian Quèze [:florian] [:flo] 2015-09-22 06:38:01 PDT
Created attachment 8664204 [details] [diff] [review]
Instrument usage of window.sidebar.addSearchEngine
Comment 27 Florian Quèze [:florian] [:flo] 2015-09-22 06:40:39 PDT
(In reply to Olli Pettay [:smaug] from comment #23)
> Do we have any data how often window.sidebar is used, or even just accessed?

AFAIK we don't.

To be honest, I don't care too much about removing window.sidebar (or even window.sidebar.addSearchEngine), what I really care about (and would like to land soon) is the removal of the sherlock code from the search service. I attached a new patch in bug 862148 that keeps the addSearchEngine method and makes it error when it's used with a sherlock engine.
Comment 28 Olli Pettay [:smaug] 2015-09-22 06:41:15 PDT
Comment on attachment 8664204 [details] [diff] [review]
Instrument usage of window.sidebar.addSearchEngine

Just because UseCounter is a new thing, I'd like nfroyd to take a look.
(but looks good)
Comment 29 Nathan Froyd [:froydnj] 2015-09-22 06:55:12 PDT
Comment on attachment 8664204 [details] [diff] [review]
Instrument usage of window.sidebar.addSearchEngine

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

LGTM, thanks.
Comment 30 Seb A 2015-09-22 08:18:44 PDT
One of the reasons for proposing removing window.sidebar was because it wasn't specced. Why not just spec it and announce it. Maybe then people will love the 'new' feature? I don't see the point in removing it when it works fine and people are using it. We recommend to all our customers that they use Firefox because it has this feature.
Comment 31 Masatoshi Kimura [:emk] 2015-09-22 08:30:35 PDT
Why do you insist window.sidebar while window.sidebar.addPanel was removed long before? How can you actively use the removed feature? Are you even testing your code?
Comment 33 Seb A 2015-09-22 08:39:08 PDT
Because you can still create sidebars via ticking the box when you bookmark something. That's what we have asked customers to do since the removal of window.sidebar.addPanel and it works fine. So we have no code. (Well apart from the stuff the runs in the sidebar.)
Comment 35 Florian Quèze [:florian] [:flo] 2015-09-23 03:44:07 PDT
(In reply to Olli Pettay [:smaug] from comment #28)
> Comment on attachment 8664204 [details] [diff] [review]
> Instrument usage of window.sidebar.addSearchEngine
> 
> Just because UseCounter is a new thing, I'd like nfroyd to take a look.
> (but looks good)

The WebIDL push hook on fx-team prevented me from pushing the patch with only r=froydnj in the commit message. I added you in the list of reviewers to push the patch, I assumed this was fine given you said the patch looks good.

Should Nathan be added in the list of accepted reviewers in the hook?
Comment 36 Olli Pettay [:smaug] 2015-09-23 03:50:15 PDT
r=me for the change. Nathan probably doesn't want to do too many .webidl reviews in general ;)
Comment 37 Wes Kocher (:KWierso) 2015-09-23 13:22:55 PDT
https://hg.mozilla.org/mozilla-central/rev/1b51fa918ebf
Comment 38 Kohei Yoshino [:kohei] 2015-09-23 20:21:04 PDT
Posted another site compat doc: https://www.fxsitecompat.com/en-US/docs/2015/sherlock-search-plugin-is-no-longer-supported/
Comment 39 Kohei Yoshino [:kohei] 2015-10-25 23:10:38 PDT
Posted yet another site compat doc: https://www.fxsitecompat.com/en-US/docs/2015/window-sidebar-will-be-removed/
Comment 40 Masatoshi Kimura [:emk] 2015-10-25 23:24:19 PDT
addSearchEngine still works for OpenSearch plugin.
Comment 41 Kohei Yoshino [:kohei] 2015-10-25 23:36:23 PDT
Um, I misread the patch in Bug 862148? I thought window.external.AddSearchProvider was the winner as documented:

https://www.fxsitecompat.com/en-US/docs/2015/sherlock-search-plugin-is-no-longer-supported/
Comment 42 Florian Quèze [:florian] [:flo] 2015-10-26 04:30:51 PDT
(In reply to Kohei Yoshino [:kohei] from comment #41)
> Um, I misread the patch in Bug 862148? I thought
> window.external.AddSearchProvider was the winner as documented:
> 
> https://www.fxsitecompat.com/en-US/docs/2015/sherlock-search-plugin-is-no-
> longer-supported/

window.external.AddSearchProvider is the winner. But window.sidebar.addSearchEngine wasn't removed immediately, we only removed support for installing sherlock plugins. We added telemetry probes to know how much window.sidebar is used, so that we can make an informed decision the next time we think about removing it.
Comment 43 Masatoshi Kimura [:emk] 2015-10-26 17:12:19 PDT
(In reply to Kohei Yoshino [:kohei] from comment #41)
> Um, I misread the patch in Bug 862148? I thought
> window.external.AddSearchProvider was the winner as documented:
> 
> https://www.fxsitecompat.com/en-US/docs/2015/sherlock-search-plugin-is-no-
> longer-supported/

addSearchEngine will be removed in the future, but
> The addPanel and addSearchEngine methods have been removed with Firefox 23 and 44 respectively
is clearly wrong. Firefox 44 still supports addSearchEngine as an alias of AddSearchProvider.
Comment 44 Kohei Yoshino [:kohei] 2015-10-30 19:49:31 PDT
Thanks for clarification! Corrected the site compat docs.

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