Overvolt Referraler

Referraler per Overvolt ;)

目前為 2017-09-27 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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