Replace images source for all images

前端 未结 3 603
不思量自难忘°
不思量自难忘° 2020-12-10 21:14

I want to replace the src attribute for all images matching a regex using Greasemonkey scripting. Example:

Replace http://aff.kooora.com/i/z3.gif

3条回答
  •  悲&欢浪女
    2020-12-10 21:42

    Just an alternative.

    In this Greasemonkey script, ProxyLoadIMG, this is accomplished without using regex.

    It was created to load images through a proxy.
    Only the images. Links and other content remains untouched.

    var proxy = 'https://proxytea.appspot.com/'
    
    for (var x=0; x

    http://aff.kooora.com/i/any.jpg becomes https://proxytea.appspot.com/aff.kooora.com/i/any.jpg
    http://aff.kooora.com/i/z3.gif becomes https://proxytea.appspot.com/aff.kooora.com/i/z3.gif
    and so on...

    No RegEx needed :)

提交回复
热议问题