Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion player.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@
color: var(--text);
font-weight: 600;
}
.now-title-link {
color: var(--accent);
text-decoration: none;
}
.now-title-link:hover {
text-decoration: underline;
}

.controls {
display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
Expand Down Expand Up @@ -1601,6 +1608,14 @@ <h3 class="modal-section-title">OBS Metadata Export</h3>
const id = extractYouTubeIdFrom(entry.trackName, entry.relativePath);
return id ? `https://youtu.be/${id}` : null;
};
const resolveYouTubeUrlFromTrack = (track) => {
if (!track) return null;
const relativePath = track.path && track.path.length > 0 ? track.path.join('/') : '';
return resolveYouTubeUrl({
trackName: track.displayName || track.name,
relativePath: relativePath
});
};

const isRewoundPercent = (percent) => typeof percent === 'number' && percent > REWIND_RATIO_THRESHOLD;
const describeHistoryStatus = (entry) => {
Expand Down Expand Up @@ -2838,7 +2853,21 @@ <h3 class="modal-section-title">OBS Metadata Export</h3>
const tr = tracks[current];
const details = recordPendingAnnouncement(tr, { skipReason });
audio.src = tr.url;
if (nowTitleEl) nowTitleEl.textContent = tr.displayName;
if (nowTitleEl) {
const youtubeUrl = resolveYouTubeUrlFromTrack(tr);
if (youtubeUrl) {
nowTitleEl.innerHTML = '';
const link = document.createElement('a');
link.className = 'now-title-link';
link.href = youtubeUrl;
link.target = '_blank';
link.rel = 'noopener';
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rel attribute should include both noopener and noreferrer for enhanced security when opening links in a new tab. This prevents the new page from accessing the window.opener property and also strips referrer information. Update to link.rel = 'noopener noreferrer';.

Suggested change
link.rel = 'noopener';
link.rel = 'noopener noreferrer';

Copilot uses AI. Check for mistakes.
link.textContent = tr.displayName;
nowTitleEl.appendChild(link);
} else {
nowTitleEl.textContent = tr.displayName;
}
}
if (nowArtistEl) nowArtistEl.textContent = (details && details.artist) ? details.artist : '—';
if (nowTrackNumberEl) nowTrackNumberEl.textContent = fmtTrackNumber(current);
const key = trackKey(tr);
Expand Down
Loading