Friday, 14 December 2018

Configuring a sidebar_action to be only on for certain sites?

I want to create a firefox extension that allows a sidebar to automatically show when a user navigates to certain web pages.

For example, let's say I configure it so if a user navigates to google.com they will be presented a sidebar that lets them see some "previous searches" they had done.

I do not want them to have to click a menu action / keyboard shortcut to display it. And I do not want to display it indefinitely.

I've been looking at these links to learn how to use sidebars:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Sidebars

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/sidebar_action

https://github.com/mdn/webextensions-examples/tree/master/annotate-page

But they do not seem to cover how to hide/show sidebars conditionally. They are just kinda, always shown. Not really what I want.

Is there a way to use sidebars in this way or should I use another method?



from Configuring a sidebar_action to be only on for certain sites?

No comments:

Post a Comment