My first Chrome extension(II)
In last post I wrote why. In this post I want to explain how I wrote my first chrome extension.
First. The Chrome Extensions developer’s documentation is quite good.
Second. A chrome extension is a zip of a folder with an crx extension instead. The folder has to have a particular file called manifest.json. It tells the extension name and the permissions asked. It also points to the main file. Pretty standard in my case.
The main file, in my case was called background.js. You should read the documentation to know more about background pages and so on.
In my case, I attach an event listener to the click of the extension button (browserAction.onclick). The listener gets the url of the current tab, process that url, encode it, get a Google url redirection from it, and ask for it.
The processing of the URL do a bit of tweaking for some specific servers. Pretty uninteresting.
First published here