Overvolt Referraler

Referraler per Overvolt ;)

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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');
  }
}