Discussions » Development

How to quick test script without copy and paste every time?

(Deleted user 1219725)
§
Posted: 16-03-2026

Hello, im new. I'm very interesting with GM and Tampermonkey and wanna write myself some script, but i dont know how to quick test, like i want to create some script for youtube, facebook,... but each time i changed something i need to copy code from vscode to tampermonkey, then reload 😭😭😭 is there anyway for instant test?

§
Posted: 16-03-2026

vite-plugin-monkey is maybe what you want. It's a vite plugin that supports dev server and hot-reload for userscript.

(Deleted user 1219725)
§
Posted: 16-03-2026
server

Thanks, i tried that but it only work well on @match webpage, so if i want to create new script for other web i need to create new project each time

§
Posted: 17-03-2026
// ==UserScript==
// @name          local test
// @description   local test
// @version       -1
// @match         https://greasyfork.org/*
// @icon          https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @require       file:///D:\Desktop\path\to\index.js
// @run-at        document-body
// @grant         none
// ==/UserScript==

// This is needed, otherwise it is not going to work
(function(){}());

And you also need to allow local files for the extension in the Chrome settings

§
Posted: 17-03-2026
Edited: 17-03-2026

As an alternative I think you can set up a web server using VS Code extension and @require localhost:3000 or whatever

Post reply

Sign in to post a reply.