[Greasemonkey] Adding an entry to a menu
Vectorspace
vectorspace at ntlworld.com
Wed Feb 22 14:15:17 EST 2006
Here's how I'd do it:
newItem=document.createElement("a");
newItem.setAttribute("href","new entry link");
newItem.setAttribute("style","border-bottom: 1px solid #6A9CCA;");
newItem.innerHTML="new entry name";
document.getElementById("sections").appendChild(newItem);
(Replace "new entry link" with the link for the new entry, and replace
"new entry name" with the name of the new entry.)
But I'm no expert. If you don't know how to write Greasemonkey scripts,
have a read of this: http://diveintogreasemonkey.org/toc/
M-E D wrote:
> Hi list,
>
> There is a forum I use that has a menu that looks like this:
>
> <div id="sections" style="background-color: #225F92; width: 110px;
> text-align: center; border-left: 1px solid white; border-right: 1px
> solid white; border-bottom: 1px solid white; display: none; margin:
> 0px; padding: 2px;">
> <a href="/forum/viewforum.php?f=15" style="border-bottom: 1px solid
> #6A9CCA;">Actualités</a>
> <a href="/forum/viewforum.php?f=5" style="border-bottom: 1px solid
> #6A9CCA;">Politique</a>
> <a href="/forum/viewforum.php?f=4" style="border-bottom: 1px solid
> #6A9CCA;">Culture</a>
> <a href="/forum/viewforum.php?f=7" style="border-bottom: 1px solid
> #6A9CCA;">Sujets Divers</a>
> <a href="/forum/viewforum.php?f=16" style="border-bottom: 1px solid
> #6A9CCA;">Vie de forum</a>
> <a href="/forum/viewforum.php?f=17" style="border-bottom: 1px solid
> #6A9CCA;">Spectacles</a>
> <a href="/forum/viewforum.php?f=18" style="border-bottom: 1px solid
> #6A9CCA;">Corpus</a>
> <a href="/forum/viewforum.php?f=19" style="border-bottom: 1px solid
> #6A9CCA;">Médias</a>
> <a href="/forum/viewforum.php?f=6" style="border-bottom: 1px solid
> #6A9CCA;">Le reste</a>
> </div>
>
> What I would like to do is a greasemonkey script that would add an
> entry to this menu but unfortunately I do not know javascript and was
> not able to figure out how to do it. Anyone can help me with this?
>
> Have a nice day everyone!
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
More information about the Greasemonkey
mailing list