How to compile the Google Chrome extension from the code I found on usercripts.org?

I came across this user account that works in Google Chrome.

I want to use it as a Google Chrome extension, as this will give me the opportunity to convert many other codes from user scripts to Google Chrome extensions.

Can someone give me a step-by-step guide on how to make a Google Chrome extension from this user 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 an answer that there is no need for this, since custom scripts can run in Google Chrome. I am doing this to learn how to make Google Chrome extensions.

Google Chrome - , !

+5
1

Google Chrome . script script, manifest.json .

:

  • script, manifest.json, .

  • , , @include @run-at manifest.json, . . .

  • Scripts Content , CSS, jQuery, (AKA script) ..

  • - , Chrome. 2 - . , .

  • , , .

+10

All Articles