Hi Guys im new to this and want to write a script to remove an image blur.

i am struggling with this. i know the reason for this is they have added something to the end of the IMG link.

for example

image1.png = normal clear image.

image1~something.png = blurred image

can anyone help me with the code to remove anything after the '~' symbol.

Thanks in advance.

Re: @ngudger2021:
Maybe something along these lines:

var blurred = document.querySelectorAll('img[src*="~"]'); // tilde anywhere in file name or path for (var counter=0; counter<blurred.length; counter++){ var badname = blurred[counter].src; var goodname=badname.substr(0, badname.indexOf("~")) + badname.substr(badname.lastIndexOf(".")); blurred[counter].src=goodname; }