I'm learning how to use Greasemonkey, and was wondering what the @namespace
metadata id is for.
Does it have to be a web address? Or can it be a folder/directory on my computer?
Does it even need to be filled in?
Greasemonkey is an extension for the Firefox browser that allows users to write or install scripts that change the functionality of a website. The scripts are executed every time a website is loaded, so Greasemonkey could be used to permanently alter a user's experience of that website.
Nampsaces are used to uniquely identify scripts for any script-specific stored preferences. For example, if you have a script like this: // ==UserScript== // @name Script Name // @namespace http://example.com // @include * // ==/UserScript== GM_setValue("key", "value");
Tampermonkey is used to run so-called userscripts (sometimes also called Greasemonkey scripts) on websites. Userscripts are small computer programs that change the layout of a page, add or remove new functionality and content, or automate actions.
To access Greasemonkey's management pane, click on the downward arrow on the right side of the button Greasemonkey to the right of your URL bar and select Manage User Scripts. This opens a tab with a list of your scripts.
A namespace is used to avoid naming collisions. If you called your script foobar
and someone else did as well, then central repositories would have a hard time telling them apart.
Therefore you should provide some URL that you control (i.e. you own it or can administrate it) that basically means "everything with that URL is by me". Now those central repositories can distinguish between foobar
from http://somesite.com/
and foobar
from http://anothersite.com
.
It's not necessary for basic operation, but strongly suggested if you want to share your scripts.
Keep in mind that mailto:[email protected]
is also a valid URL and might be a possible option when you don't own or control a domain of your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With