// ==UserScript== // @name vk.com del redir // @version 1.0 // @description Deletes VK.com url redirects // @author AndShy // @match http://vk.com/* // @match https://vk.com/* // @license GPL-3.0 // @homepageURL https://greasyfork.org/en/users/384289-andshy // @run-at document-end // @grant none // @namespace https://greasyfork.org/users/384289 // @downloadURL none // ==/UserScript== (function() { 'use strict'; document.onmouseover = handler; function handler(event) { var evt = event.target if (evt) { //console.log(evt.tagName) if (evt.tagName.includes('A')) { //console.log(evt.href) if (evt.href){ //console.log(decodeURIComponent(evt.href)) var link = decodeURIComponent(evt.href) evt.href = link.replace(/^(?:http.?.*\?to\=)(.*?)(?:\&.*)?$/,'$1') } } } } })();