Input wanted - what kinds of intermediate examples of WebExtensions APIs do you want to see added to extension development documentation?


(Caitlin Neiman) #1

To illustrate simple ways to use WebExtensions APIs for extension development, we maintain a repository of extension code examples.

We have heard some feedback that while these examples are generally helpful, they do not address advanced use cases required for building more complex extensions. To bridge that gap, we would like to add more examples of intermediate uses of WebExtensions APIs to our development documentation, and we would like to hear your thoughts on what would be most helpful.

What kinds of intermediate examples would you like to see? Have you written any code that shows off more advanced use cases of WebExtensions APIs that you would be willing to share with the community?

Let us know by commenting in the thread below!


We need You
(Viswaprasath) #2

One of the Strong change I would like to see is the structured way of learning WebExtension. Check this website Rust docs I personally feel its easy way to learn.

The MDN example page have very huge number of examples which is very great, but think of the first time developer who would like to get started he wont know where to start.


(Sylvain Giroux) #3

Here is an example of an intermediate extension that uses alarms, notifications, storage (with sync), browser-polyfill and promises for cross-browser compatibility. The code is easy to read and not should not be overwhelming for beginners.

Source code is under the Mozilla Public License 2.0 license.

One thing that could be improved with this extension is the usage of multi-languages. It’s not currently using i18n in the way a web-extension should be implemented via https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization . That could be a nice entry point for a developer to dig in the code, understand the interaction between the APIs and create changes around it’s Internationalization feature.

One downside of this extension is that the content-script is configured to be executed on a website that is blocked to non Quebec residents.

Cheers!


(Trishul Goel) #4

Here is an example which details about browser’s management API, this list down all the extensions installed in the browser and displays the permission used by each of them. This is cross browser and uses a custom polyfill(convert callbacks to promise only).