DEV Community

Cover image for Creating Firefox browser extensions for covid-19–4
Nabendu
Nabendu

Posted on • Originally published at nabendu.blog

Creating Firefox browser extensions for covid-19–4

Alt Text

Welcome to part-4 of the series. As, the title tells i will be creating some firefox extensions to help in the covid-19 crisis. Since, there are already some good sites which are helping us to track the infection, i decided to build some extensions.

As all of us know that how important to wash our hands in this crisis, but we all forget to do the same when busy working from home.

This extension will be called Wash Your hands and will be similar to the 3 extensions, created in part-3.

So, go ahead and create a folder WashYourhands and inside it another folder icons. Inside that folder place an icon and name it icon.png

icon.pngicon.png

Now, create a file manifest.json inside the folder WashYourhands and put the below content in it.

manifest.jsonmanifest.json

Next, create a file background.js and put the below content in it.

background.jsbackground.js

Again will to publish this addon to the mozilla addon store and will follow the procedure explained in part-2 of this series.

I had followed the procedure and submitted the firefox extension and it is Awaiting Review now.

AddonAddon

The next extension which i want to create is Covid-19 Advices. These are the advice given on WHO site https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public

So, these advices will be shown randomly in browser notification.

So, go ahead and create a folder Covid-19Advices and inside it another folder icons. Inside that folder place an icon and name it icon.png

Covid-19AdvicesCovid-19Advices

Now, create a file manifest.json inside the folder Covid-19Advices and put the below content in it.

manifest.jsonmanifest.json

Next, create a file background.js and put the below content in it. The getRandom() is a bit different then earlier function, as it’s an array of object. When we are calling it in onAlarm.addListener, we are getting both title and message.

background.jsbackground.js

It’s time to publish this covid-19 addon to the mozilla addon store and will follow the procedure explained in part-2 of this series.

I had followed the procedure and submitted the firefox extension and it is Awaiting Review now.

Covid-19 AdvicesCovid-19 Advices

Finally, both of my Covid-19 addons are approved and you can add it to firefox from https://addons.mozilla.org/en-US/firefox/user/15774633/

So, go ahead and share these covid-19 addons.

Covid-19 addonsCovid-19 addons

This complete part-4 of the series. You can find the code for the same in my github account here.

Top comments (0)