Software engineers love to build software which will make their life easier. I am one of the strong believer of this. I write many backend code and automation scripts so my manual jobs gets done easily. During my college days I used to develop Apps, during that time I had same motto, the apps I develop should help me. With same motto I sat last night and wanted to develop an Add-on which can solve my problem. One of the distracing problem for me when I work is “Changing the youtube song, pausing it when some one comes and talks to me”. For this I have to search the tab and pause in case the song is my favourite one and in some case if the song is not good have to move to next.
So to do this I need to have a easy accessible icon and when I click the icon I need two buttons, one is mainly for play / pause and another is to move to next song.
I started with designing the basic HTML page with 3 buttons in it. One button is for controlling play/pause, one for playing next song. This two options will be working in any normal youtube video. Adding another option which will be used for replaying the song, this will work only in jukebox.
Here I have to access only the tabs with URL containing youtube, check the tabs API in MDN, queryed all the youtube which have youtube in it. After fetching the tab, the next thing I have to find is the which tab the youtube running. Then based on the action I have to execute the script, regarding the executeScript read in MDN. I will share the detailed code flow in my next blog.
Around 2 AM I submitted my addons to addons.mozilla.org and slept. Around 3 PM ( yes in 13 hours) one Add-on reviewer approved my add-on I went live in AMO.
Got excited as my First WebExtension went live, so posted it in Product Hunt. If you feel this is good make sure you upvote it and share your comments so add-ons can be imporved in next release.
Tweeted about my Extension, also
Just added my first @MozWebExt which was developed last night in @ProductHunt https://t.co/6zO8Hk6x3N @mozillaTN @MozillaIN #happy— VP7 (@iamVP7) March 31, 2017
Some of the to-do for my add-ons is
- Integrating music streaming website like Gaana.
- Replaying the last song in youtube.
Note: It was very difficult to share the extension link I had to my friends from Chrome Store. Was not able to know whether it is approved and published or not.
In my next post I will share more about the code Flow in detail. Share the website which you wanted to integrate.
Update 1 : Added to Chrome Store.