Skapar en tråd där vi kan dela olika tillägg som skapar fler funktioner på flashback och som kan vara nyttiga för flashbacks användare.
Här är en Brave Chrome och Chromium baserad tillägg.
Exempel
https://ibb.co/Y7z5k0gJ
manifest.json
[PHP]{
"manifest_version": 3,
"name": "Flashback Post Hider",
"version": "1.0",
"description": "Add a button to hide individual posts on flashback.org",
"permissions": ["scripting", "activeTab"],
"content_scripts": [
{
"matches": ["https://www.flashback.org/t*"],
"js": ["content.js"]
}
]
}[/PHP]
content.js
[PHP]function getHiddenPosts() {
return JSON.parse(localStorage.getItem('fbHiddenPosts') || '[]');
}
function saveHiddenPosts(hiddenIds) {
localStorage.setItem('fbHiddenPosts', JSON.stringify(hiddenIds));
}
function hidePostById(postId) {
const post = document.querySelector(`[data-postid="${postId}"]`);
if (post) {
post.style.display = 'none';
}
}
function addHideButtons() {
const hiddenPosts = getHiddenPosts();
document.querySelectorAll('[data-postid]').forEach(post => {
const postId = post.getAttribute('data-postid');
// If already hidden, apply immediately
if (hiddenPosts.includes(postId)) {
post.style.display = 'none';
}
// Avoid adding duplicate buttons
if (post.querySelector('.fb-hide-btn')) return;
// Find the "Rapportera" link
const reportLink = Array.from(post.querySelectorAll('a'))
.find(a => a.textContent.trim() === "Rapportera");
if (reportLink) {
// Create "Dölj" button
const btn = document.createElement('button');
btn.textContent = 'Dölj permanent';
btn.className = 'fb-hide-btn';
btn.style.marginRight = '5px';
btn.style.background = '#f44';
btn.style.color = '#fff';
btn.style.border = 'none';
btn.style.padding = '3px 6px';
btn.style.cursor = 'pointer';
btn.style.borderRadius = '3px';
btn.style.fontSize = '12px';
btn.addEventListener('click', () => {
post.style.display = 'none';
if (!hiddenPosts.includes(postId)) {
hiddenPosts.push(postId);
saveHiddenPosts(hiddenPosts);
}
});
// Insert button before "Rapportera"
reportLink.parentNode.insertBefore(btn, reportLink);
}
});
}
// Initial run
addHideButtons();
// Keep watching for new posts (e.g., infinite scroll)
const observer = new MutationObserver(addHideButtons);
observer.observe(document.body, { childList: true, subtree: true });
[/PHP]
Här är en Brave Chrome och Chromium baserad tillägg.
Citat:
Tillägget skapar en knapp under varje flashback inlägg. Klickar du på knappen döljs inlägget för alltid. Alltså så rensar du trådar själv skulle man kunna säga. Du blir en egen flashback moderator. Du tar bort bajs inlägg och tråden blir mycket mer kvalitativ.
Exempel
https://ibb.co/Y7z5k0gJ
manifest.json
[PHP]{
"manifest_version": 3,
"name": "Flashback Post Hider",
"version": "1.0",
"description": "Add a button to hide individual posts on flashback.org",
"permissions": ["scripting", "activeTab"],
"content_scripts": [
{
"matches": ["https://www.flashback.org/t*"],
"js": ["content.js"]
}
]
}[/PHP]
content.js
[PHP]function getHiddenPosts() {
return JSON.parse(localStorage.getItem('fbHiddenPosts') || '[]');
}
function saveHiddenPosts(hiddenIds) {
localStorage.setItem('fbHiddenPosts', JSON.stringify(hiddenIds));
}
function hidePostById(postId) {
const post = document.querySelector(`[data-postid="${postId}"]`);
if (post) {
post.style.display = 'none';
}
}
function addHideButtons() {
const hiddenPosts = getHiddenPosts();
document.querySelectorAll('[data-postid]').forEach(post => {
const postId = post.getAttribute('data-postid');
// If already hidden, apply immediately
if (hiddenPosts.includes(postId)) {
post.style.display = 'none';
}
// Avoid adding duplicate buttons
if (post.querySelector('.fb-hide-btn')) return;
// Find the "Rapportera" link
const reportLink = Array.from(post.querySelectorAll('a'))
.find(a => a.textContent.trim() === "Rapportera");
if (reportLink) {
// Create "Dölj" button
const btn = document.createElement('button');
btn.textContent = 'Dölj permanent';
btn.className = 'fb-hide-btn';
btn.style.marginRight = '5px';
btn.style.background = '#f44';
btn.style.color = '#fff';
btn.style.border = 'none';
btn.style.padding = '3px 6px';
btn.style.cursor = 'pointer';
btn.style.borderRadius = '3px';
btn.style.fontSize = '12px';
btn.addEventListener('click', () => {
post.style.display = 'none';
if (!hiddenPosts.includes(postId)) {
hiddenPosts.push(postId);
saveHiddenPosts(hiddenPosts);
}
});
// Insert button before "Rapportera"
reportLink.parentNode.insertBefore(btn, reportLink);
}
});
}
// Initial run
addHideButtons();
// Keep watching for new posts (e.g., infinite scroll)
const observer = new MutationObserver(addHideButtons);
observer.observe(document.body, { childList: true, subtree: true });
[/PHP]
__________________
Senast redigerad av pOXE 2025-08-10 kl. 13:56.
Senast redigerad av pOXE 2025-08-10 kl. 13:56.