Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Neopets Username Blurrinator
- // @namespace http://tampermonkey.net/
- // @description Context menu to blur usernames and pet names on common pages for screenshot purposes. Right-click on a page -> Tampermonkey -> Neopets Username Blurrinator to activate it. Do it again to deactivate it.
- // @version 1.0
- // @author Rippy
- // @include http*://*.neopets.com/*
- // @require http://code.jquery.com/jquery-latest.js
- // @run-at context-menu
- // ==/UserScript==
- (function() {
- 'use strict';
- const applyBlur = (e) => {
- if ($(e).text() == appInsightsUserName) { // don't blur out own username. not foolproof but eh
- return;
- }
- if (!$("#blurrinator").length) {
- $(e).css({
- "filter": "blur(6px)",
- "-webkit-filter": "blur(6px)",
- "-moz-filter": "blur(6px)",
- "-o-filter": "blur(6px)",
- "-ms-filter": "blur(6px)"
- });
- }
- else {
- $(e).css({
- "filter": "blur(0px)",
- "-webkit-filter": "blur(0px)",
- "-moz-filter": "blur(0px)",
- "-o-filter": "blur(0px)",
- "-ms-filter": "blur(0px)"
- });
- }
- }
- const processPage = () => {
- $("a[href*='userlookup.phtml?user='], a[href*='randomfriend.phtml?user='], a[href*='randomfriend.phtml?randomfriend='], a[href*='browseshop.phtml?owner='], a[href*='/gallery/index.phtml?gu='], a[href*='/trophy.phtml?username='], a[href*='/petlookup.phtml?pet=']").each(function (k, v) {
- // heavily derived from diceroll123's User Tagger https://gist.github.com/diceroll123/be1465e82d12f2d23d8a w/ minor modifications
- applyBlur(v);
- });
- if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/island\/tradingpost.phtml*/)) { // tp
- $("p > b").each((i, e) => {
- applyBlur(e);
- });
- }
- if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/auctions.phtml*/)) { // auction house
- if (window.location.href.includes("auction_id")) { // specific auctions
- $("b").each((i, e) => {
- if (e.innerText.match(/\(owned by (.+)\)/)) {
- applyBlur(e);
- }
- });
- $("table:eq(7) tr td:nth-child(1)").each((i, e) => {
- if (i > 0) {
- applyBlur(e);
- }
- });
- }
- else {
- $("table:eq(9) tr td:nth-child(4), table:eq(9) tr td:nth-child(8)").each((i, e) => { // auction main pages
- if (i > 0) {
- applyBlur(e);
- }
- });
- }
- }
- if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/genie.phtml*/)) { // auction genie
- $("table:eq(7) tr td:nth-child(4), table:eq(7) tr td:nth-child(8)").each((i, e) => {
- if (i > 0) {
- applyBlur(e);
- }
- });
- }
- if (window.location.href.match(/^https?:\/\/(?:w*).?neopets.com\/donations.phtml*/)) { // money tree
- $(".item-benefactor > b").each((i, e) => {
- applyBlur(e);
- });
- }
- if ($("#blurrinator").length) {
- $("#blurrinator").remove();
- }
- else {
- $("<div id='blurrinator' style='display: none;'></div>").insertAfter($("body"));
- }
- }
- processPage();
- })();
Advertisement
Add Comment
Please, Sign In to add comment