A while ago I made a simple add-on for Firefox and Chrome / Chromium to be able to check from its desktop browser if the hackerspace of Athens is open . Below I will write briefly how I made it. Of course, the add-on code is available under a free software license. First, let's go into the process of looking at the add-on functionality itself. We have a physical space, the hackerspace of Athens (yeaheee!). This site actually opens whenever we have an event or is one of its managers there. How could we know when it's open outside the event? The hackerspace on its home page on the web has a "counter" that shows whether and how this site was opened for visitors. But how does that work? The hackerspace like most of the world's hackerspace follows a protocol called SpaceAPI that gives us the necessary information on whether it is open. SpaceAPI is a Javascript Object Notation ( JSON) output , one of its nice features is that it's easy for people to read it and easy for machines to produce and understand it. Well, if we go to hackerspace's SpaceAPI, we'll see something like this.
My original purpose was to create an add-on for Firefox as it has been the browser I prefer for several years now. An excellent source of information for web technologies is the Mozilla Developer Network or MDN which has a lot of information. According to the article, in Firefox we have several tools and ways to create an add-on. In our case what is the best tool for creating an add-on? Reading then we find that from the end of 2017 onwards WebExtensions will be the standard add-on tool, but one of their positive is that they are built to work with the same code in most modern browsers as FIrefox, Chrome, Edge, and Opera. Practical sounds to see how easy it is. This is basically a collection of files described by a manifest.json and these can actually be html or js using a browser's API. It seems that we also have the necessary tools to make our record and try it out. A text editor and a browser. It is good to have them all gathered in a separate directory in which we will work them. To put them in a row, we want to create an add-on with an icon, a test loop will run in the background to check the JSON of the hackerspace and tell us if it's open, and since the fantastic sys- admin of hackerspace tells us how much a world we have in we will show and that, we will also add functionality so that when we click on the icon to show us the central site of hackerspace. So by reading the extensive documentation we have, our manifest.json should look something like this.
What will I put on my background.js? First, will I define the doorAPI I'll find it?
Now, how do we give it to the world? First we need to prepare our record. We create a .zip file. In Linux on a command line we do this as follows: First we go to the directory where we have our add-on files where of course path / to / my-addon / directory with various program files. cd path/to/my-addon/ And then we give the command zip -r ../my-addon.zip * A new zip file will be created my-addon.zip. For Mozilla's add-on gallery go to addons.mozilla.org and upload our file after a basic check from various scripts is checked and then uploaded for review. This basically means that our code is checked by a Mozilla volunteer, its good functioning is confirmed and good practices are recommended, and the possible presence of malicious code is also checked here. This in my case meant 3-4 days of waiting. In the case of Chrome things are not exactly that, since we uploaded our file and checked out from various scripts of control it was. It goes up without going through the supervision of someone. Will you tell me, and what happened? In the case of Chrome, it gets up quickly without bureaucracy. Correctly; Not exactly. Can a "malicious" developer put code that controls the user's presence online or even exploit many of the browser's features. I think that as a practice the choice of Mozilla to control the code that runs the add-on even though it is more time-consuming practice is at least for our users. All this I would not have done without the help, and the guidance of members and hackerspace visitors who helped me. Finally, I recall that I am not an IT practitioner, so this guide probably contains errors and inaccuracies |
Comunication is the art of combine information
Imagination is the mental capacity to picture things.
Categories
All
Hall of FameJohn Conway
Post Archives
January 2024
if you ain´t new ideas then you need learn new stuff.
XPRICEShot trends |