System list recombobulator

Takes the console list in the header and remakes it with your own chosen list of consoles.

Od 15.05.2014.. Pogledajte najnovija verzija.

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           System list recombobulator
// @description    Takes the console list in the header and remakes it with your own chosen list of consoles.
// @version        1
// @author         King of Cats
// @namespace      Cats
// @grant          none
// @include        http://www.gamefaqs.com/*
// ==/UserScript==

// Feel free to make changes and redistribute as long as you make it known you're distributing an edited version of this script.

var mainNav = document.evaluate('//nav[@class="masthead_systems"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

if  (mainNav !== null) {

	var moreSystems = document.evaluate('//span[@class="masthead_platform_drop"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
	
	var links = mainNav.getElementsByTagName("a");
	for (var i = links.length-1; i >= 0; i--) {
		if (links[i].parentNode == mainNav) {
			links[i].parentNode.removeChild(links[i]);
		}
	}
	
	/* Default values as an example */
	//var newNames = ["3DS","DS","iPhone","PC","PS3","PS4","PSP","Vita","Wii U","Xbox 360","Xbox One"];
	//var newLinks = ["3ds","ds","iphone","pc","ps3","ps4","psp","vita","wii-u","xbox360","xboxone"];
	
	/* Custom entries */
	var newNames = ["","",""];
	var newLinks = ["","",""];
	
	var newAnchors = new Array();
	
	for (var i = 0; i < newNames.length; i++) {
		newAnchors[i] = document.createElement('a');
		newAnchors[i].setAttribute('href', '/'+newLinks[i]);
		newAnchors[i].textContent = newNames[i];
		mainNav.insertBefore(newAnchors[i],moreSystems);
	}

}