vor ähnlichkeitsprüfung

This commit is contained in:
2025-12-21 14:21:55 +01:00
parent ffcfce2b31
commit fde5ab91c8
14 changed files with 721 additions and 50 deletions

View File

@@ -643,23 +643,23 @@ function getPostUrl(postElement, postNum = '?') {
if (mainPostLink) {
console.log('[FB Tracker] Post #' + postNum + ' - Found main post URL:', mainPostLink, postElement);
return { url: mainPostLink, allCandidates };
return { url: mainPostLink, allCandidates, mainUrl: mainPostLink };
}
// Fallback to first candidate
if (allCandidates.length > 0) {
console.log('[FB Tracker] Post #' + postNum + ' - Using first candidate URL:', allCandidates[0], postElement);
return { url: allCandidates[0], allCandidates };
return { url: allCandidates[0], allCandidates, mainUrl: '' };
}
const fallbackCandidate = extractPostUrlCandidate(window.location.href);
if (fallbackCandidate) {
console.log('[FB Tracker] Post #' + postNum + ' - Using fallback URL:', fallbackCandidate, postElement);
return { url: fallbackCandidate, allCandidates: [fallbackCandidate] };
return { url: fallbackCandidate, allCandidates: [fallbackCandidate], mainUrl: '' };
}
console.log('[FB Tracker] Post #' + postNum + ' - No valid URL found for:', postElement);
return { url: '', allCandidates: [] };
return { url: '', allCandidates: [], mainUrl: '' };
}
function expandPhotoUrlHostVariants(url) {
@@ -2792,6 +2792,34 @@ async function createTrackerUI(postElement, buttonBar, postNum = '?', options =
const selectElement = container.querySelector(`#${selectId}`);
const deadlineInput = container.querySelector(`#${deadlineId}`);
selectElement.value = '2';
const mainLinkUrl = postUrlData.mainUrl;
if (mainLinkUrl) {
const mainLinkButton = document.createElement('button');
mainLinkButton.className = 'fb-tracker-mainlink-btn';
mainLinkButton.type = 'button';
mainLinkButton.title = 'Main-Link öffnen';
mainLinkButton.setAttribute('aria-label', 'Main-Link öffnen');
mainLinkButton.style.cssText = `
width: 28px;
height: 28px;
padding: 0;
border-radius: 6px;
border: 1px solid #ccd0d5;
background-color: #ffffff;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2365766b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10 13a5 5 0 0 1 0-7l2-2a5 5 0 0 1 7 7l-1 1'/><path d='M14 11a5 5 0 0 1 0 7l-2 2a5 5 0 0 1-7-7l1-1'/></svg>");
background-repeat: no-repeat;
background-position: center;
background-size: 16px 16px;
cursor: pointer;
`;
addButton.insertAdjacentElement('afterend', mainLinkButton);
mainLinkButton.addEventListener('click', (event) => {
event.preventDefault();
event.stopPropagation();
window.open(mainLinkUrl, '_blank', 'noopener');
});
}
if (deadlineInput) {
// Try to extract deadline from post text first