In order to ease development i want to serve the necessary TM
@require files through a localhost HTTP(S) server. I expected these files to be reloaded on each page reload.
The files are fetched from the localhost server when i update the UserScript in the TM editor, however, they are not fetched when a matched URL is loaded. I'm not sure if this is a caching thing by TM or if i'm doing something wrong here.
To separate concerns in the JS files, the UserScript header is separated from other logic. The necessary files are imported using @required. This is the content of the UserScript file that is pasted in the TM editor:
// @name myName
// @description myDescription
// @author robinlarondelle
// @version 0.1
// @namespace myNameSpace
// @homepage myHomePage
// @include *linkedin.com/*
// @icon https://www.google.com/s2/favicons?domain=linkedin.com
// @grant window.onurlchange
// @require https://localhost:3000/public/myScript.user.js
The localhost HTTPS static file server is a Node.JS server with a self signed certificate to enable HTTPS. When using Postman and FireFox after providing my
.pem file, the server works as expected. If necessary i can provide more details about the server, but i don't think the problem resides here.
The main question/problem is: Why does
@require from the UserScript header only fetch the required files on Script Save in the TM editor, but not on Page Reload when the URL matches? Is this normal behavior and/or can we turn this off?
Subscribe to get latest updates