Help overriding a sites background image

Discussion in 'Hardware, Software, Tech' started by Anpu, Sep 11, 2022.

Thread Status:
Not open for further replies.
  1. Anpu

    Anpu Avatar

    Messages:
    7,944
    Likes Received:
    9,015
    Trophy Points:
    153
    Location:
    Hemut
    I know a few of you do some HTML coding and I was just wondering if you could help me out with something.

    The SOTA Wiki uses this default background image and then uses a black background color:
    Code:
    background: url(https://sotawiki.net/images/9/90/Bgbody.jpg) no-repeat center top;
    
    What I don't know how to do (if you even CAN do), is keep the website from using/loading that image?

    For me, that image has this light area, that when previously visited links in a dark blue color, just have no contrast at all, and I find it really difficult to read.

    I AM able to remove that image temporarily in Chrome using the Developer Tools (just select that file link and delete). But as soon as you update the page it goes back to using the image again.

    Is there something I can do/use?
     
  2. Lained

    Lained Avatar

    Messages:
    2,803
    Likes Received:
    4,794
    Trophy Points:
    165
    Location:
    Yeovil, England
    You could try the User CSS extension, to overwrite the background/change the link colours, though I'd report the problem to the admin with an example maybe they can modify the look so it's no longer an issue?
     
    FrostII and Anpu like this.
  3. Rhodrisan

    Rhodrisan Avatar

    Messages:
    14
    Likes Received:
    35
    Trophy Points:
    15
    Gender:
    Male
    Background image is coming from a stylesheet loaded in the head. Either remove the line from the stylesheet - or at the bottom of the head section add a style with background-image: none
     
  4. Anpu

    Anpu Avatar

    Messages:
    7,944
    Likes Received:
    9,015
    Trophy Points:
    153
    Location:
    Hemut
    I can’t edit the website. I can only visit it.
     
  5. Rustford

    Rustford Avatar

    Messages:
    11
    Likes Received:
    23
    Trophy Points:
    3
    If you use ublock origin(you should), you can block it using one of its filters. Click the browser icon, find the icon with the little gears that says 'Open the dashboard' when you hover over it, click it
    go to the 'My filters' tab and add this:
    Code:
    ||sotawiki.net/*/Bgbody.jpg$image
    
    click 'Apply Changes'

    you'll probably need to clear your browser's cache to get it to work properly
     
    Anpu likes this.
  6. Lazlo

    Lazlo Avatar

    Messages:
    1,499
    Likes Received:
    3,227
    Trophy Points:
    113
    I think the simplest way would be to just make a userscript. You can use the tampermonkey extension, which is supported by all major browsers.

    A userscript basically just injects javascript into the code of any pages that match the url paramaters that it's given. Changing background color and images is very simple with js, and learning how to make basic userscripts is useful for all kinds of things.

    If you do try and get stuck, let me know and I can help.

    edit: This will remove the background image on every page of the sotawiki.net domain on your end. You can modify the url if that's too broad.

    Code:
    // ==UserScript==
    // @name         Remove SotA Wiki Background Image
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  removes sota wiki background image
    // @author       who cares
    // @match        https://sotawiki.net/*
    // @grant        none
    // ==/UserScript==
    
    document.body.style.backgroundImage = "url('')";
    
     
    Last edited: Sep 13, 2022
    Anpu likes this.
Thread Status:
Not open for further replies.