18

Greasemonkey 4.0 has changed its interface, and for the life of me I cannot find any way to create a new script.

enter image description here

Brock Adams
  • 82,642
  • 19
  • 207
  • 268
matthew_360
  • 5,593
  • 6
  • 30
  • 39
  • 1
    @BrockAdams, thanks for that comment. Switching to Tampermonkey was a much quicker alternative. Scooter's answer does work, but this is much quicker and more effective, in my case at least. – blaze_125 Nov 17 '17 at 21:00
  • 2
    Related: [How to Transfer All Greasemonkey userscripts to Tampermonkey on Firefox 57+](https://stackoverflow.com/questions/47317983/how-to-transfer-all-greasemonkey-userscripts-to-tampermonkey-on-firefox-57) – Brock Adams Nov 17 '17 at 21:11

3 Answers3

10

Update: this was fixed in version 4.1 on 11-Dec-2017 (thankfully someone opened a bug for it)

Greasemonkey 4.1 menu


It really seems like version 4.0 has no way to do this (and is very poorly documented) and so my workaround was just to install a simple/short script that seemed low risk and then just edit that script to make it my own.

I used this script (source code to check for safety) and clicked the green "Install" button near the upper right of the page:

The button

This installed it into Greasemonkey.

After that, you can click on the Greasemonkey toolbar icon, click on the script you just added, and then click "Edit" in the submenu to edit it.

scooter
  • 146
  • 1
  • 6
5

The easiest way for me is to move the script to localhost, visit it through the browser and then click on "Install". (script name must be for example "myscript.user.js")
https://wiki.greasespot.net/Greasemonkey_Manual:Installing_Scripts

2

I used Vit Kolos' answer, which worked great. But there is additional information you might need.

(1) Vit's method requires that you have xampp or wamp/mamp/lamp installed and running. (Free software - google and install)
(2) Create a folder called by the name of the website (for e.g.: c:\xampp\htdocs\gm\wnd.com)
(3) Copy the script into the (for eg) c:\xampp\htdocs\gm\wnd.com folder, with the file named (again for eg) wnd.com.user.js.
(4) In the browser address bar, type localhost/gm/wnd.com (if that is what you named the folders).
(5) You should now see the file wnd.com.user.js in the list of files - click on it.
(6) You will open the script (text) file - but
(7) At bottom it will count down from 5-to-1 and then display the install button. Nice and neat.

To EDIT your installed script: (1) Click the GM icon and it will drop down with a list of installed scripts. You should see your script listed there. Click on it, and you will have the option to edit. Or
(2) Navigate to C:\Users\YOUR_USER_NAME\AppData\Roaming\Mozilla\Firefox\Profiles\YOUR_OWN_PROFILE.default\gm_scripts\wnd.com\ and edit wnd.com.user.js in sublime or atom or Notepad++ or ... (If you don't know how to get to appdata\roaming then this method is not for you...)

Note that if you use jQuery, you should also:

(1) Ensure that your script has jQuery referenced in the header via @require, for e.g.:

// ==UserScript==
// @name        wnd.com
// @namespace   wnd.com
// @description wnd.com
// @include     *://*.wnd.*/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @version     1
// @grant       none
// ==/UserScript==

$(function(){
    //your script goes here
});
halfer
  • 18,701
  • 13
  • 79
  • 158
cssyphus
  • 31,599
  • 16
  • 79
  • 97
  • For debugging purpose, [http-server with node](https://www.npmjs.com/package/http-server) or [SimpleHttpServer with Python2](https://docs.python.org/2/library/simplehttpserver.html) / [http.server with Python3](https://docs.python.org/3/library/http.server.html) should be much easy to use. – tsh Dec 26 '17 at 08:33