Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.2k stars 417 forks source link

file URL content is not updated in `UserScripts API Dynamic` mode #2184

Open jb222 opened 3 days ago

jb222 commented 3 days ago

TM stopped updating local .css files.

Expected Behavior

After fine-tuning local .css file, page reload should import the new styles.

Actual Behavior

The older .css file is still active.

Specifications

Script

// @grant GM_getResourceText // @resource my_styles file:///Users/.../Documents/userscripts/style.css

const styles_1 = GM_getResourceText("my_styles"); GM_addStyle(styles_1);

How to force update

Both work (compare with the lines above).

  1. Change the external file name (and the corresponding @resource line). // @resource my_styles file:///Users/.../Documents/userscripts/style_new-name.css

  2. Or only change the variable name. const styles_2 = GM_getResourceText("my_styles"); GM_addStyle(styles_2);

derjanb commented 1 day ago

What is the value of the Content Script API setting?

jb222 commented 1 day ago

I just checked and the wrong behaviour is only in Dynamic Mode. In normal API Mode, it's working fine.