Skip to content

Commit 18ee902

Browse files
authored
Added open in new tab feature
1 parent 3de69b0 commit 18ee902

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

project.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,27 @@ function getCookie(name) {
55
if (parts.length === 2) return parts.pop().split(';').shift();
66
}
77
// get cookie
8+
if (getCookie('ST Features').includes('open-new-tab')) {
9+
waitforit()
10+
function waitforit() {
11+
if (document.querySelector('#view > div > div.inner > div:nth-child(2) > div.flex-row.project-notes') === null) {
12+
window.setTimeout(waitforit, 100)
13+
} else {
14+
var openlink = document.querySelectorAll('a')
15+
openlink.forEach(function(link) {
16+
if (link.parentNode.parentNode === document.querySelector('#navigation > div > ul')) {
17+
} else {
18+
link.target = '_blank'
19+
link.rel = 'noopener noreferrer'
20+
}
21+
})
22+
}
23+
}
24+
}
825
// april fool's day (start)
926
const d = new Date();
1027
console.log(d.getDate())
11-
if (d.getDate() === 1) {
28+
if (d.getDate() === 31) {
1229
checkapril();
1330
function checkapril() {
1431
if(document.querySelector('#view > div > div.inner > div:nth-child(2) > div.guiPlayer > div > div:nth-child(1) > div > div > div.controls_controls-container_2xinB > img.stop-all_stop-all_1Y8P9') === null) {

0 commit comments

Comments
 (0)