Outreachy Internship with Mozilla:Week-2 – Shruti Singh – Medium
https://medium.com/@shruti9520/outreachy-internship-with-mozilla-week-2-959d05fe9808?source=rss-f9133b07a948------3
Hello folks!
This week was good. Last week I learnt about building themes and this week I actually implement these. In this blog I’ll explain about building dynamic themes.
Introduction
A theme and browser extension functionality cannot be defined in one package. One can, however, programmatically include a theme in an extension using the Theme API and those themes are called dynamic themes.
I made one dynamic theme where themes are changing according to the time of day. After that I added an additional functionality using browser action. So, a user can add an alarm to it’s forefox page using browser action button.After setting alarm( in hours), whenever the hour matches with the alram time hour, the page produces a sound and theme is changed for one minute. After one minute the theme is again resumed with the particular day time theme. It was fun making this. :-)
Getting Started
First you need to create a manifest.json file within your main folder. This file specify basic metadata and theme components. My manifest.json file looks as follows-
manifest.json
Here “permissions” is necessary to request “theme” for building Dynamic themes. For including browser action, we add “browser_action” in manifest.json. But what is browser action? A browser action is a button that your extension adds to the browser’s toolbar. The button has an icon, and may optionally have a popup whose content is specified using HTML, CSS, and JavaScript. Here the popup content is specified in “alarm.html”. In this pop up you can set alarm ( in hours).
Next, you need to build a JSON object containing the information about your theme. See the example below-
Theme that appears when alarm hours matches with the current time( written in alarm.js file).
Day, night themes ( written in background.js file)-
Lastly, pass the JSON object in a theme.update() call as shown below-
So, building a dynamic theme is fun. All you need is to keep some points in mind and tada~ theme is built. :-D
I would like to attach a GIF of the dynamic theme. Note that I am writing this blog during day time, so the GIF has day theme along with an alarm theme which user can set at any hour.
At the end, I would like to thank my awesome mentor Les Orchard. :-) He is assigning some cool stuffs to me and answers all my doubts. :-D
Thanks for reading. If you are having any suggestions or thoughts on this, be sure to leave a comment. :-)
Bye Bye :-D
GitHub - ChrisCindy/node-web-console: A simple web-based SSH, remote shell in your browser built with Node.js
https://github.com/ChrisCindy/node-web-console
lmorchard starred ChrisCindy/node-web-console
Classic Tools Retrospective: Tim Sweeney on the first version of the Unreal Editor
https://gamasutra.com/blogs/DavidLightbown/20180109/309414/Classic_Tools_Retrospective_Tim_Sweeney_on_the_first_version_of_the_Unreal_Editor.php
Outreachy Internship with Mozilla: Week-1 – Shruti Singh – Medium
https://medium.com/@shruti9520/outreachy-internship-with-mozilla-week-1-d56223db51f7?source=rss-f9133b07a948------3
Hi there!
My first week of Outreachy internship with mozilla was as good as expected. I got LDAP credentials. But wait, what does that mean? It means you get mozilla specific email address, own profile at mozilla Phonebook, access to all mozilla websites, access to their slack/ircCloud account and what not? You get to take part in their team meetings too which is pretty cool. :-)
So, the first day of my internship started with a warm welcom from the community and my mentor Les Orchard. My mentor is an awesome person. :) He gave me an outline of what work he expects me to do. So, I started with learning about building themes ( both static and dynamic). I would like to give a rough idea about what I leant.
Theme is something that enables you to change the look of the browser. You should have a little idea about WebExtension API before building a theme. So, theme can be static or dynamic.
STATIC THEMES-
We can’t share static themes with other users. Creating a static theme is simple. You need to include image inside a folder ( same folder where manifest.json [Web extension] file is present).In manifest.json file “theme” is the main object which consist of “images,”color” etc. Static image themes can consist of single or multiple images.We can also build static animated images.
DYNAMIC THEMES-
We can share static themes with other users. Dynamic theme uses theme API for controlling theme using JS code. For including theme API fiirst you need to request “theme” permission in the extension’s manifest.json file. Then you build a JSON object same as static theme and lastly you pass the JSON object in a theme.update() call.
Whatever I have written above might be a confusing to you. Don’t worry! My next week work is based on implementing “building themes” and I will write an elaborated blog with some code snippet. :-)
Lastly, I would like to thank Les Orchard for guiding me and also for inviting me to attend weekly Firefox Color meeting on Vidyo. It was very nice meeting Wil, John, Marnie and all members of FireFox Color team. It feels grate when cool people like them acknowledge your presence even when you have nothing much to say. :-)
Thank you! :-D
Are My Friends Really My Friends?
https://nytimes.com/2018/05/12/style/who-are-my-real-friends.html?smid=tw-nytimes&smtyp=cur
Meet the Renegades of the Intellectual Dark Web
https://mobile.nytimes.com/2018/05/08/opinion/intellectual-dark-web.html
A 2-Year Stanford Study Shows the Astonishing Productivity Boost of Working From Home
https://inc.com/scott-mautz/a-2-year-stanford-study-shows-astonishing-productivity-boost-of-working-from-home.html
GitHub - iodide-project/iodide: A frictionless portable notebook-style interface for literate scientific computing in the browser
https://github.com/iodide-project/iodide
lmorchard starred iodide-project/iodide
Making a Web Thing on the ESP8266 – Mozilla Hacks : the Web developer blog
https://hacks.mozilla.org/2018/04/making-a-web-thing-on-the-esp8266
I’m Not Black, I’m Kanye
https://theatlantic.com/entertainment/archive/2018/05/im-not-black-im-kanye/559763
GitHub - Kyria/EFTParser: A python text blocks parser for the famous Eve Online application : Eve Fitting Tool
https://github.com/Kyria/EFTParser
lmorchard starred Kyria/EFTParser
How to Build a Universe That Doesn’t Fall Apart Two Days Later
https://urbigenous.net/library/how_to_build.html
Why the Future Belongs to Polymaths
https://medium.com/@ztrana/the-expert-generalist-why-the-future-belongs-to-polymaths-46b0e9edc7bc
My name is Wil Wheaton. I live with chronic Depression, and I am not ashamed.
http://wilwheaton.net/2018/05/my-name-is-wil-wheaton-i-live-with-chronic-depression-and-i-am-not-ashamed
Data Violence and How Bad Engineering Choices Can Damage Society
https://medium.com/s/story/data-violence-and-how-bad-engineering-choices-can-damage-society-39e44150e1d4
Old Pal Recipe | SAVEUR
https://www.saveur.com/article/recipes/old-pal-rye-negroni-cocktail
Ingredients
2 oz. rye whiskey
1 oz. Campari
1 oz. dry vermouth
Lemon twist, for garnish
The Redistribution of Sex
https://nytimes.com/2018/05/02/opinion/incels-sex-robots-redistribution.html
Rust in production at Figma
https://blog.figma.com/rust-in-production-at-figma-e10a0ec31929
The Dirty War Over Diversity Inside Google
https://wired.com/story/the-dirty-war-over-diversity-inside-google
GitHub - jwilm/alacritty: A cross-platform, GPU-accelerated terminal emulator
https://github.com/jwilm/alacritty
lmorchard starred jwilm/alacritty
Millennials are struggling. Is it the fault of the baby boomers?
https://theguardian.com/society/2018/apr/29/millennials-struggling-is-it-fault-of-baby-boomers-intergenerational-fairness