Topic: e621 mobile version

@Raygen

Raygen said:
This works flawlessly, thanks a lot!
It adds much value to the functionality of the site

I've been trying to convert this to a Tampermonkey script to make it run automatically, but without success. Maybe you can help me figure this out?

I'm glad you liked it.

Use this:

(function() {

        // console.log('repair start');

        var list = document.getElementsByTagName('a');
        for (var index = 0; index < list.length; index++) {
            if (list[index].innerHTML.search('webm') > -1 && list[index].innerHTML.search('img') > -1) {
                list[index].innerHTML = list[index].innerHTML.replace('img', 'video controls loop');
            }
        }
        // console.log('repair ends');
        

})();

https://pastebin.com/MrUAGh64

Updated by anonymous