only _blank links while downloading. fixed safari link after download
This commit is contained in:
parent
432a39d313
commit
859554ce21
8 changed files with 74 additions and 60 deletions
19
frontend/src/links.js
Normal file
19
frontend/src/links.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
let links = []
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
links = document.querySelectorAll('a:not([target])')
|
||||
})
|
||||
|
||||
function setOpenInNewTab(bool) {
|
||||
if (bool === false) {
|
||||
links.forEach(l => l.removeAttribute('target'));
|
||||
}
|
||||
else {
|
||||
links.forEach(l => l.setAttribute('target', '_blank'));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setOpenInNewTab
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue