Jump to content

Greasemonkey or Stylish for Changing Picture on Website Locally

Thermite
Go to solution Solved by Dr3nz4r,

I'd suggest Greasemonkey...
I could give you a script I do use on a different site, to change thier Logo with a one I made, hence theirs looks so god damn shitty :D

// ==UserScript==// @name       LogoChanger v1.0.5// @namespace   http://linustechtips.com/main/user/576-dr3nz4r/// @author      Julain aka Fresh aka Dr3nz4r// @description replaces the any logo with one of your wish// @include     http://linustechtips.com/*// @include     *.linustechtips.com/*// @version     1.0.5// @grant       none// ==/UserScript==// saves all settings of all <img> tags in the tags variable/arrayvar tags = document.getElementsByTagName('img');// goes through every entry in the tags array, so through every <img> tagfor (var i = 0; i < tags.length; i++) { // replaces the searched image src with the one you want. This happens in ALL <img> tags with the searched src  tags[i].src = tags[i].src.replace('https://linustechtips.com/main/public/style_images/1_Linus-Tech-Tips-Equal-2.png', 'http://puu.sh/5m5vU.png');}

For use, replace the two @include URLS like they are in the example script which replaces the LTT Logo, then change the image url's in the second last code line like this:

src.replace('https://linustechtips.com/main/public/style_images/1_Linus-Tech-Tips-Equal-2.png', 'http://puu.sh/5m5vU.png');

replace the first URL with the content of the img src (e.g

<img src="xxx" alt="yyy" />

) and the second one with your image src (e.g http://puu.sh/5m5vU.png)

so it looks like this:

src.replace('xxx', 'http://puu.sh/5m5vU.png');

The images src can be found via the sourcecode, the most easiest way is with FireBug or the Webkit development tools of your Browser.

Thats what the whole tag should look like (bottom, blue marked):
 
5m5Nu.png

the Logo of this forum looks like this after applying the script:

5m5R2.png

Everyone know what greasemonkey and stylish are for firefox right. If not go look it up now because they are amazing add ons. I want to know how you would go about replacing one picture on a website with another permanently using an add-on like Greasemonkey or Stylish. I don't know how to write any code for these add ons. Anyone have any suggestions on how I could do this. 

This is my opinion, it doesn't mean I'm right and is liable to change at any time. I may offend of which I apologize in advance.


(Our lord and savior: GabeN)

Link to comment
Share on other sites

Link to post
Share on other sites

I'd suggest Greasemonkey...
I could give you a script I do use on a different site, to change thier Logo with a one I made, hence theirs looks so god damn shitty :D

// ==UserScript==// @name       LogoChanger v1.0.5// @namespace   http://linustechtips.com/main/user/576-dr3nz4r/// @author      Julain aka Fresh aka Dr3nz4r// @description replaces the any logo with one of your wish// @include     http://linustechtips.com/*// @include     *.linustechtips.com/*// @version     1.0.5// @grant       none// ==/UserScript==// saves all settings of all <img> tags in the tags variable/arrayvar tags = document.getElementsByTagName('img');// goes through every entry in the tags array, so through every <img> tagfor (var i = 0; i < tags.length; i++) { // replaces the searched image src with the one you want. This happens in ALL <img> tags with the searched src  tags[i].src = tags[i].src.replace('https://linustechtips.com/main/public/style_images/1_Linus-Tech-Tips-Equal-2.png', 'http://puu.sh/5m5vU.png');}

For use, replace the two @include URLS like they are in the example script which replaces the LTT Logo, then change the image url's in the second last code line like this:

src.replace('https://linustechtips.com/main/public/style_images/1_Linus-Tech-Tips-Equal-2.png', 'http://puu.sh/5m5vU.png');

replace the first URL with the content of the img src (e.g

<img src="xxx" alt="yyy" />

) and the second one with your image src (e.g http://puu.sh/5m5vU.png)

so it looks like this:

src.replace('xxx', 'http://puu.sh/5m5vU.png');

The images src can be found via the sourcecode, the most easiest way is with FireBug or the Webkit development tools of your Browser.

Thats what the whole tag should look like (bottom, blue marked):
 
5m5Nu.png

the Logo of this forum looks like this after applying the script:

5m5R2.png

CPU: Intel i7 4790K @4.8GhZ  CPU Cooler: Be Quiet! Dark Rock Pro 2  Motherboard: Gigabyte Z97 UD3H  GPU: Asus ROG RX 480 8G OC Memory: 32GB Gskill Ares 2400Mhz  Storage: 2x Crucial M4 512GB SSD (raid0)  / 1TB Seagate FireCuda SSHD Case: Phanteks Enthoo Evolv ATX PSU: EVGA SuperNOVA P2 750W  Operating System: Windows 10 Enterprise LTSB (64 bit) Other: NZXT Hue+ LED Controller with 8 LED Strips for desk and PC lighting

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 months later...
  • 2 weeks later...

So what would I need to change all jpg's to a set jpg? Still new to the grease ;)  reading up though.

I roll with sigs off so I have no idea what you're advertising.

 

This is NOT the signature you are looking for.

Link to comment
Share on other sites

Link to post
Share on other sites

Found it :)

 

 

// ==UserScript==// @[member='Name Change'] All Images// @namespace Aaron Russell// @include *// @[member=Grant]       none// ==/UserScript==var pic = "http://www.makeuseof.com/wp-content/uploads/2008/12/greasemonkeylogo.gif";var a = "-1";while (a<document.images.length) {a++;document.images[a].src=pic;}
I dare you to try it Edited by IdeaStormer

I roll with sigs off so I have no idea what you're advertising.

 

This is NOT the signature you are looking for.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×