fixed: 修复在同时开启多个窗口的情况下刷新页面导致的死循环情况
This commit is contained in:
@@ -63,7 +63,11 @@ const vueFilePathPlugin = (outputFilePath) => {
|
||||
return html.replace(
|
||||
'</body>',
|
||||
`<script>
|
||||
const isWindowActive = () => !document.hidden;
|
||||
window.addEventListener('beforeunload', function () {
|
||||
if (!isWindowActive()) {
|
||||
return;
|
||||
}
|
||||
fetch('/generate-path-name-map');
|
||||
});
|
||||
</script></body>`
|
||||
|
Reference in New Issue
Block a user