Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Fanboi.ch Greentext
- // @namespace Violentmonkey Scripts
- // @match *://*/*
- // @include https://fanboi.ch/*
- // @grant none
- // @version 1.0
- // @author Gu
- // @description 1/1/2020, 9:04:43 PM
- // ==/UserScript==
- var posts = document.querySelectorAll(".post");
- posts.forEach(function(post){
- post.querySelectorAll("p").forEach(function(p){
- var lines = p.innerHTML.split("<br>");
- var greentext = [];
- lines.forEach (function(text){
- greentext.push(text.replace(/(^>(?!>).*)/, "<span class=\"quote\">$1</span>"));
- });
- p.innerHTML = greentext.join("<br>");
- });
- });
- document.body.innerHTML += "<style>.quote {color:green} </style>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement