小编Shi*_*ita的帖子

如何使用我在userscripts.org找到的代码编译Google Chrome扩展程序?

我发现这个用户在谷歌浏览器中运行.

我希望将其用作Google Chrome扩展程序,因为这样我就可以将许多其他代码从用户脚本转换为Google Chrome扩展程序.

有人可以给我一步一步的教程,了解如何使用此用户代码制作Google Chrome扩展程序吗?

// ==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 …
Run Code Online (Sandbox Code Playgroud)

google-chrome userscripts google-chrome-extension

6
推荐指数
1
解决办法
4623
查看次数