![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Sep 2015
Posts: 1,045
|
chrome extension - gift for gfy friends
I notice some of you are sad and depressed. This may help your life This is not my code, but I find it and modify.
I get tired of seeing pornhub on reddit every week. So I find a simple extension that replaces words. You can modify to what you want. content.js Code:
var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; for (var j = 0; j < element.childNodes.length; j++) { var node = element.childNodes[j]; if (node.nodeType === 3) { var text = node.nodeValue; var replacedText = text.replace(/pornhub/gi, '[advertisement]'); if (replacedText !== text) { element.replaceChild(document.createTextNode(replacedText), node); } } } } Code:
{ "manifest_version": 2, "name": "[goodbyelosers]", "description": "[replaces pornhub with advertisement]", "version": "1.0", "content_scripts": [ { "matches": [ "*://*/*" ], "js": [ "content.js" ], "run_at": "document_end" } ] }
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
|||||||
|
|||||||
Bookmarks |