Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
Comment
[i]Italic Text[/i]
[b]Bold Text[/b]
[spoiler]Spoiler Text[/spoiler]
>Highlight/Quote Text
[pre]Preformatted & Monospace Text[/pre]
[super]Superset Text[/super]
[sub]Subset Text[/sub]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Grease Monkey/Javascript help

Reply
- Fri, 08 May 2020 20:50:06 EST tKnjSqOP No.122889
File: 1588985406929.jpg -(6034B / 5.89KB, 186x186) Thumbnail displayed, click image for full size. Grease Monkey/Javascript help
I've been trying to figure this out for awhile and can't get it to work...

How do I turn images that are like


google.com/butts/a6r74/monkey.jpg
google.com/butts/18gd3/monkey.jpg
google.com/butts/2t5u9/monkey.jpg


...into...

google.com/butts/monkey.jpg


I tried this but it doesn't work...

document.body.innerHTML = document.body.innerHTML.replace('google.com/butts/*/monkey.jpg,
'google.com/butts/monkey.jpg);
>>
HamiltonSurrystare.dao - Sat, 09 May 2020 01:26:47 EST +odHCy7V No.122890 Reply
What you're trying to do is this:

document.body.innerHTML.replace(/google\.com\/butts\/.+\/monkey\.jpg/i,'google.com/butts/monkey.jpg);


This won't match images with relative paths and you should probably be changing image paths in place instead of rewriting the page.

Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.