Greasy Fork is available in English.

Discussions » Creation Requests

I think it is an easy script

§
Posted: 4.9.2018

I think it is an easy script

Im a noob in coding, so i just tell you what in want in my noob code

if page is www.xyz.de/cat/* (maybe more /*) if i click on the button with the class="button" redirect to www.xyz.de/finish

Can somebody help me please :)

§
Posted: 5.9.2018
// ==UserScript==
// @name         redirect to finsh
// @namespace   www.xyz.de/finish
// @version      0.1
// @include      *://www.xyz.de/cat/*
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
    //the frist button means the button elements,'.button' means class='button'
    [].forEach.call(document.querySelectorAll('button.button'),item=>{
        item.addEventListener('click',()=>document.location='//www.xyz.de/finish')
    });
})();

maybe this can work,or maybe not

Post reply

Sign in to post a reply.