Created
February 14, 2026 08:17
-
-
Save seasick/83e100657cd53a9e11255451d8805741 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Wowhead Dressing Room Background Replacer | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Replaces the model viewer background with a 1x1 green pixel | |
| // @author You | |
| // @match https://www.wowhead.com/classic/dressing-room* | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const TARGET_URL = 'https://wow.zamimg.com/modelviewer/classic/background-181818.png'; | |
| // 1x1 green pixel as a data URI | |
| const GREEN_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg=='; | |
| // Override fetch | |
| const originalFetch = window.fetch; | |
| window.fetch = function(url, options) { | |
| if (url && url.toString().includes('background-181818.png')) { | |
| return originalFetch(GREEN_PIXEL, options); | |
| } | |
| return originalFetch.apply(this, arguments); | |
| }; | |
| // Override XMLHttpRequest | |
| const originalOpen = XMLHttpRequest.prototype.open; | |
| XMLHttpRequest.prototype.open = function(method, url, ...rest) { | |
| if (url && url.toString().includes('background-181818.png')) { | |
| return originalOpen.call(this, method, GREEN_PIXEL, ...rest); | |
| } | |
| return originalOpen.apply(this, arguments); | |
| }; | |
| // Override Image src setter for dynamically created images | |
| const originalImageDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src'); | |
| Object.defineProperty(HTMLImageElement.prototype, 'src', { | |
| get: function() { | |
| return originalImageDescriptor.get.call(this); | |
| }, | |
| set: function(value) { | |
| if (value && value.toString().includes('background-181818.png')) { | |
| return originalImageDescriptor.set.call(this, GREEN_PIXEL); | |
| } | |
| return originalImageDescriptor.set.call(this, value); | |
| } | |
| }); | |
| console.log('[BG Replacer] Script loaded - background image will be replaced with green pixel'); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment