Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Greasemonkey namespace needed for?

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?

like image 932
Nope Avatar asked Dec 22 '08 16:12

Nope


People also ask

What is Greasemonkey used for?

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.

What is namespace in UserScript?

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");

Is Greasemonkey the same as Tampermonkey?

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.

How do I read a script on Greasemonkey?

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.


1 Answers

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.

like image 66
Joachim Sauer Avatar answered Sep 28 '22 05:09

Joachim Sauer