Open matt-tingen opened 5 years ago
I gave tamperdav a try, but it being mutually exclusive with browser sync makes it a hard sell.
@matt-tingen Have you seen this https://github.com/Tampermonkey/tampermonkey/issues/475#issuecomment-348594785 especially point 2?
@matt-tingen Have you seen this #475 (comment) especially point 2?
So you might need to execute/load the page twice.
That is exactly what we would like to avoid. Need a way to have just one page reload as with file require.
Would love to see this implemented (preferably as a whitelist to not wait every time for download of 3rd party libraries). I am using webpack-userscript and it works well, but the need to always refresh three times before Tampermonkey picks up changes is annoying.
It would be very useful.
On firefox, the only way I found to get the required script updated in one time is to add a ?whatever
after the address of script and change the part after the ?
before saving the script. TM see it as a new script and download it everytime.
I would also love to see this. My current dev setup is to use a local server and just include the userscript headers in TM. The biggest pain point is having to manually open up the dashboard and increment my script version for every change I build/deploy. The option to turn off caching would be awesome.
Reloading is tedious, so I created a simple script that retrieves the file with GM.xmlHttpRequest and reloads it if it has changed.
// ==UserScript==
// @name name
// @version 0.1
// @match https://
// @grant GM.xmlHttpRequest
// @grant GM.getValue
// @grant GM.setValue
// @require LOCALHOST_URL
// ==/UserScript==
(async function() {
GM.xmlHttpRequest({
url: LOCALHOST_URL,
onload: async(response) => {
const text=response.responseText;
const storageData = await GM.getValue("CachedScriptKey");
if(text!=storageData){
console.log("reload!");
await GM.setValue("CachedScriptKey",text);
location.reload();
}else{
console.log("NO reload!");
}
}
});
})();
Hi Team,
Any updates on this? my team is facing the same issue
Currently, I use local http server, and load JS files from it with @require.
But I have to do 1 force cache reload and 2 reloads in my firefox browser (even though in the externals it seems that it updates even before that).
Please, find a solution, I develop userscripts on daily basis, and this is such a pain to reload 3 times😄
If anyone needs, look at this solution, that i'm experimenting with. It seems that it's working even on firefox.
it would be great to be able to use like variables on the // @require like %random% and put it on the query
// @grant GM.xmlHttpRequest // @grant GM.getValue // @grant GM.setValue
the only problem is that tampermonkey is asking me special permisions for the xmlHttpRequest
Any chance the suggestion in #475 (@-directive to avoid caching externals) could be reconsidered given #347? Without
file://
access in Firefox, there's not a great way to develop scripts.My method of dev in Chrome was to generate the header once with
file://
URLs and edit the required scripts in my own editor. This was great because I can just make changes, switch to the browser, and reload. With Firefox I can use a local server to work around thefile://
limitation, but I would have to also increment the version within Tampermonkey as part of the dev cycle.Alternatively to an @-directive, perhaps an option to set e.g. a domain blacklist for which resource won't be cached. Then I could add e.g.
localhost:8080
to the list and it would function likefile://
URLs.