37338-vm/patch_index.py
2026-03-02 07:38:53 +00:00

22 lines
417 B
Python

import re
with open('index.php', 'r') as f:
content = f.read()
patch_code = """
instanceModalElement.addEventListener('hidden.bs.modal', function () {
if (window.matrixNeedsRefresh) {
window.location.reload();
}
});
});
</script>
"""
content = content.replace("});\n</script>", patch_code)
with open('index.php', 'w') as f:
f.write(content)
print("Patched index.php")