Overvolt Referraler

Referraler per Overvolt ;)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Overvolt Referraler
// @description Referraler per Overvolt ;)
// @author Maxeo | maxeo.net
// @license https://creativecommons.org/licenses/by-sa/4.0/
// @include     https://www.amazon.it/*/dp/*
// @include     https://www.amazon.it/dp/*
// @include     https://www.amazon.it/gp/product/*
// @include     https://www.banggood.com/*
// @version     1.0.3
// @icon        https://greasyfork.org/system/screenshots/screenshots/000/008/599/original/photo_2017-09-28_00-48-18.jpg?1506552632
// @namespace https://greasyfork.org/users/88678
// ==/UserScript==
function updateURLParameter(url, param, paramVal) {
  var newAdditionalURL = '';
  var tempArray = url.split('?');
  var baseURL = tempArray[0];
  var additionalURL = tempArray[1];
  var temp = '';
  if (additionalURL) {
    tempArray = additionalURL.split('&');
    for (var i = 0; i < tempArray.length; i++) {
      if (tempArray[i].split('=') [0] != param) {
        newAdditionalURL += temp + tempArray[i];
        temp = '&';
      }
    }
  }
  var rows_txt = temp + '' + param + '=' + paramVal;
  return baseURL + '?' + newAdditionalURL + rows_txt;
}
if (window.location.host == 'www.banggood.com') {
  if (window.location.pathname.substr( - 5) == '.html') {
    if (window.location.href != updateURLParameter(window.location.href, 'p', '63091629786202015112')) {
      window.location.href = updateURLParameter(window.location.href, 'p', '63091629786202015112');
    }
  }
} else {
  if (window.location.href != updateURLParameter(window.location.href, 'tag', 'overVolt-21')) {
    window.location.href = updateURLParameter(window.location.href, 'tag', 'overVolt-21');
  }
}