MV ref tpm

Block ref links in MV

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 or Violentmonkey 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        MV ref tpm
// @namespace   [email protected]
// @description Block ref links in MV
// @include http*://mediavida.com/*
// @include http*://www.mediavida.com/*
// @version     1
// @grant       none
// ==/UserScript==

var scriptCode = []; // Vamos a guardar el script aqui
var expression = new RegExp(/https?:\/\/(www\.)?amazon\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)

scriptCode.push('function amazon(){}'); // Vamos a reemplazar la función
var script = document.createElement('script'); // Creamos el objeto script
script.innerHTML = scriptCode.join('\n');
scriptCode.length = 0;
document.getElementsByTagName('head') [0].appendChild(script);

var links = document.getElementsByTagName('a');
var url;
for(var i=0; i<links.length; i++) {
  if (expression.test(links[i].href)) {
    url = links[i].href.split('%3F')
    links[i].setAttribute('href', url[0])
  }
}