03 November 2017 13:45
GREASEMONKEY (v.4 - webextention) - FIR 57 - Greasespot: Greasemonkey 4 For Script Authors
What?
The Greasespot Wiki will be updated to explain Greasemonkey 4 in detail. Until then, here's a quick summary.
First, there is only an embedded editor. Browser Extensions have no access to the file system, so you can no longer author user scripts in your familiar text editor.
There is only one object provided to user scripts now, named GM. It has several properties. One of them is info – the equivalent of the old GM_info. There are also several methods of this object: getResourceUrl, deleteValue/getValue/listValues/setValue, xmlHttpRequest.
To use these methods you still need @grant, and use the new name, e.g.:
// @grant GM.setValue
The new form has a dot, where the old form has an underscore. You may specify both @grants, if you'd like to be compatible with Greasemonkey 4 and other user script engines at the same time. As of today, there is no support for: GM_log (use console.log), GM_addStyle, GM_registerMenuCommand, nor GM_getResourceText.
1
(1 marks)