Closed Bug 1322985 Opened 9 years ago Closed 9 years ago

Can't install themes from the Discovery Pane in (OmniSidebar's) Add-ons Sidebar

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: quicksaver, Unassigned)

Details

OmniSidebar (use version 1.6.14 to test [1]) lets you open the Add-ons Manager in the sidebar. So far I've gotten the new Discovery pane to work in it almost completely (initially there was a problem with it trying to call history.replaceState [2]). Except for themes. I can't figure out why they're not working, neither clicking the switch installs it or mousing over the image shows the preview (screencast at [3]). All works fine from the normal Add-ons Manager tab of course. I would really appreciate some help figuring this out. There are no errors or messages in the console, I can't figure out a call stack or anything of the sort, and the disco.js file is just too huge and complex to follow without already knowing how it's supposed to work (my starting point was searching for "theme" in it, but there's so much going on I don't know what I'm looking for in there). I don't even really know what's failing, if it's the click handlers, messages with the browser side or something else. :( [1] https://addons.mozilla.org/firefox/addon/omnisidebar/versions/1.6.14 [2] https://github.com/Quicksaver/OmniSidebar/commit/6be8468c6652bc77e35d5ce91950fafadf6a06c2 [3] https://github.com/Quicksaver/OmniSidebar/issues/144
Jorge, I don't know who usually works in the disco pane, maybe andym? Do you know if there's someone I could ping that could take a quick look? I'm not looking for a solution really, just hopefully the cause, or even a nudge in the right direction would be something already.
Flags: needinfo?(jorge)
Do extensions work? There were changes to limit permission to mozAddonsManager to certain domains and certain XUL pages. It would probably be something to do with bug 1245993, but that's a tracking bug, not sure where the actual change was.
Flags: needinfo?(jorge)
Yeah, extensions work perfectly. I can un/install uBlock and Awesome Screenshot Plus through the one-click switcher in the sidebar without a problem. I expected some sort of error would appear in the console about not having permissions to do it, am I wrong about expecting that? Regardless, the XUL page that loads in the sidebar in this case is still about:addons, so there shouldn't be any issue about that. I would hope at least. Don't know if this helps: if I open the add-ons manager normally (in a tab) while keeping the add-ons sidebar open, go to the disco pane in the tab and install a theme from there, the disco pane in the add-ons sidebar immediately updates itself without a problem (i.e. the switcher for that theme becomes green). So it can detect theme changes at least, it just can't un/install/preview the themes itself.
Flags: needinfo?(aswan)
The discovery pane uses two different APIs here. Installing extensions and monitoring what is and is not installed uses mozAddonManager. Previewing and installing themes uses custom DOM events: http://searchfox.org/mozilla-central/rev/51aa673e28802fe6ea89f4793721fc55334a6ac8/browser/base/content/content.js#887-889 These two different APIs also unfortunately use two different rules to determine when they are available. The short of it is that the code that governs whether the custom theme events are available is here: http://searchfox.org/mozilla-central/rev/51aa673e28802fe6ea89f4793721fc55334a6ac8/browser/base/content/browser-addons.js#675-691 To use those events, you need to be on a page with an https url where the host has the "install" permission. I don't see any easy dependable way to make that work from an extension.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(aswan)
Resolution: --- → WONTFIX
(In reply to Andrew Swan [:aswan] from comment #4) > To use those events, you need to be on a page with an https url where the > host has the "install" permission. I don't see any easy dependable way to > make that work from an extension. As I mentioned, the add-ons manager "page" that loads in the sidebar is still about:addons, exactly the same as opens normally in a tab, which in turn also loads the exact same discovery page (https://discovery.addons.mozilla.org/en-US/firefox/discovery/pane/...) It's basically opening the add-ons manager (the same one that is implemented by Firefox itself) somewhere else other than in a tab. Permissions shouldn't be a problem as long as they are set for the discovery page (which I made sure they are before testing of course); again, it's the exact same page being loaded in the sidebar and in the tab, if the tab has permission to do it, the sidebar must also have it. Unless you meant that code is not fetching the correct baseURI to check when in the sidebar, which seems extremely unlikely given that it's fetched by the content itself and is passed through a message. I think you did point me in the right direction though. LightWeightThemeWebInstallListener's message listener isn't responding when trying to install themes, so either the content process isn't firing those while in the sidebar or the chrome process's listener isn't receiving them. Either way, it's a very good starting point. Thanks! :)
You need to log in before you can comment on or make changes to this bug.