Hey there, I know the title might seem confusing but my aim is to utilize tampermonkey to create a userscript that defines a function which I can execute in the console whenever a page (like Discord) loads. The userscript code appears like this:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://discord.com/channels/@me
// @grant none
// ==/UserScript==
(function() {
'use strict';
function alert1() {
alert();
}
})();
Just to reiterate, I wish to embed the above code into a userscript. And then I would like to be able to invoke the alert1();
from the console.