I came across this userscript which works in Google Chrome.
I want to use it as Google Chrome extension as this will give me experience to convert many other codes from userscripts to Google Chrome Extensions.
Can someone give me a step by step tutorial of how to make a Google Chrome Extension out of this userscript code?
// ==UserScript==
// @name Facebook Ads Hider
// @author Jose Luis Martin
// @namespace http://joseluismartin.info
// @description Hide Ads on Facebook
// @include http://www.facebook.com/*
// @run-at document-start
//
// ==/UserScript==
if (document.addEventListener) {
document.addEventListener("DOMNodeInserted", onNodeInserted, false);
}
// Event listener to hide ads containers
function onNodeInserted(event) {
target = event.target;
if (target.className == "ego_column") {
hideElement(target);
}
}
// trivial hide of ads container
function hideElement(elto) {
elto.style.visibility = "hidden";
elto.style.hight = "0px";
elto.style.width = "0px";
}
Please do not give a reply that there is no need for this as userscripts can be natively run on Google Chrome. I am doing this to learn how to make Google Chrome extensions.
The Google Chrome extension tutorial is very bad for understanding and makes me vomit - I don't know who made it!