Yes, and in Greasemonkey it's pretty easy. If you want to split your scripts into i18n.js , utils.js and your main script tag (and had them in that order in the original script), just change the script title to read something like this
i18n.js
var hello = 'bonjour!';
utils.js
function say(msg) { alert(msg); }
my.user.js
// ==UserScript== // @name My nifty script // @namespace Your unique author identifier // @require i18n.js // @require utils.js // ==/UserScript== say(hello);
... and Greasemonkey will download and install all three files, attach to them in the order specified in your @require (the main script is the last), and execute it as usual. Put them in the same directory on the server where you distribute them, or remember to include the full URLs in the @require statements where they are located on the network.
ecmanaut
source share