Creating Firefox browser extensions for covid-19–4

Welcome to part-4 of the series. You can find part-3 here.

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

Image for post
Image for post
icon.png

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

Image for post
Image for post
manifest.json

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

Image for post
Image for post
background.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.

Image for post
Image for post
Addon

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

Image for post
Image for post
Covid-19Advices

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

Image for post
Image for post
manifest.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.

Image for post
Image for post
background.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.

Image for post
Image for post
Covid-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.

Image for post
Image for post
Covid-19 addons

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

You can find part-5 here.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store