RPGEN - screenshot

download image of canvas;

// ==UserScript==
// @name         RPGEN - screenshot
// @author       none
// @namespace    https://rpgen.us/dq/maps/
// @version      0.3
// @description  download image of canvas;
// @match        https://rpgen.site/dq/?map=*
// @grant        GM.registerMenuCommand
// @license      MIT
// ==/UserScript==
(window => {
    'use strict';
    const {$} = window;
    GM.registerMenuCommand('screenshot', () => {
        $('<a>').attr({
            href: $("canvas").get(1).toDataURL(),
            download: `RPGEN ${window.g_curDir}.png`
        }).get(0).click();
    });
})(window.unsafeWindow || window);