aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-28 18:12:53 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-28 18:13:03 +0300
commite2c71a4bd41470b9503021db36be2ae65f345d97 (patch)
treef368fae32ea56ea10fb6642254b7fce9d7acaccc
parentcd7e8fb42b447efa77319aa8931cf5f5e65c418e (diff)
make prevent the browser from using cached version of scripts when they change
-rw-r--r--modules/ui.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 9f4cfda1..4e082408 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1692,14 +1692,14 @@ def create_ui():
def reload_javascript():
- head = f'<script type="text/javascript" src="file={os.path.abspath("script.js")}"></script>\n'
+ head = f'<script type="text/javascript" src="file={os.path.abspath("script.js")}?{os.path.getmtime("script.js")}"></script>\n'
inline = f"{localization.localization_js(shared.opts.localization)};"
if cmd_opts.theme is not None:
inline += f"set_theme('{cmd_opts.theme}');"
for script in modules.scripts.list_scripts("javascript", ".js"):
- head += f'<script type="text/javascript" src="file={script.path}"></script>\n'
+ head += f'<script type="text/javascript" src="file={script.path}?{os.path.getmtime(script.path)}"></script>\n'
head += f'<script type="text/javascript">{inline}</script>\n'