Skip to content

Instantly share code, notes, and snippets.

@NikIvan
Created October 30, 2016 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NikIvan/8821a00c182ef92143c70b27a2427486 to your computer and use it in GitHub Desktop.
Save NikIvan/8821a00c182ef92143c70b27a2427486 to your computer and use it in GitHub Desktop.
vk.com tracking urls to real
var nodeList = document.querySelectorAll('a[href^="/away.php?to=http"]');
var elements = [];
for(var i = 0, len = nodeList.length; i <= len; i += 1) {
elements.push(nodeList[i]);
}
elements.forEach((el, i) => {
var goodHref = decodeURIComponent(el.href);
goodHref = goodHref.slice(27, goodHref.indexOf('&post='));
el.href = goodHref;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment