sitoctt/static/local-file-tweaks.js

16 lines
309 B
JavaScript

(function(){
if (location.protocol !== 'file:') {
return;
}
window.addEventListener('load', (function(){
Array.from(document.querySelectorAll('a[href]')).forEach(function(linkEl){
if (linkEl.href.startsWith('file://') && linkEl.href.endsWith('/')) {
linkEl.href += 'index.html';
}
});
}));
})();