Heres my solution, just keep adding the ones you want to remove with the detach(menu[optionIndex]) format the optionIndex its the index starting from 0, to add new elements just follow the format append(menu, option(href, text), location) 'beforeend' so its goes at the end of the list or 'afterbegin' if you want it at the beging. If you need help just PM me. @(you need an account to see links)
I dont like to use Jquery, so my code might look a little longer but it works
Code:
// ==UserScript==
// @(you need an account to see links) Neopets DropDown Links Remover
// @(you need an account to see links)space com.hectordev
// @(you need an account to see links)cription Removes Neopets DropDown Links
// @include *.neopets.com/*
// @version 1
// @grant none
// ==/UserScript==
(function() { 'use strict';
var $ = function $(selector, context){
return context === undefined ? document.querySelector(selector) : context.querySelector(selector);
},
$$ = function $$(selector, context){
return (context === undefined) ? document.querySelectorAll(selector) : context.querySelectorAll(selector);
},
detach = function detach(element){
var parent = element.parentNode;
if (!parent) { return; }
parent.removeChild(element);
return element;
},
append = function append(parent, element, where){
parent.insertAdjacentElement(where, element);
},
option = function option(href, text){
var li = document.createElement('li');
var a = document.createElement('a');
a.innerHTML = "� " + text;
a.href = href;
append(li, a, 'beforeend');
return li;
}
var nav = $$('.dropdown', $('#template_nav'));
// USE THESE TO ADD
var myaccount = nav[0];
var customise = nav[1];
var games = nav[2];
var explore = nav[3];
var news = nav[4];
var community = nav[5];
var shops = nav[6];
var ncmall = nav[7];
var premium = nav[8];
// USE THESE TO REMOVE
var myaccountMenu = $$('li', myaccount);
var customiseMenu = $$('li', customise);
var gamesMenu = $$('li', games);
var exploreMenu = $$('li', explore);
var newsMenu = $$('li', news);
var communityMenu = $$('li', community);
var shopsMenu = $$('li', shops);
var ncmallMenu = $$('li', ncmall);
var premiumMenu = $$('li', premium);
// ======================= REMOVES
detach(myaccountMenu[0]); // control panel
detach(myaccountMenu[1]); // preferences
detach(customiseMenu[5]); // pound
detach(gamesMenu[1]); // popular
// keep adding.
// ======================= ADD
append(myaccount, option('http://www.neopets.com/gallery/index.phtml', 'Gallery Index'), 'beforeend'); // inserts new element into my account at the end.
append(games, option('http://www.neopets.com/safetydeposit.phtml', 'SBD'), 'afterbegin'); // inserts new element into games at the begin.
})(this);