Har fått flashscript att fungera på alla sidor nu.
Några förändringar:
Kod:
if (window.location.href.match("flashback.org/t"))
{
blir:
Kod:
if (window.location.href.match("flashback.org/t") || window.location.href.match("flashback.org/p")
|| window.location.href.match("flashback.org/sp"))
{
Kör skriptet på varje gång man visar topic.
För bilder (ersätt den gamla if-satsen):
Kod:
function ProcessImageLinks(currentAnchor)
{
if (window.location.href.indexOf("flashback.org/p") == -1 &&
window.location.href.indexOf('flashback.org/t') == -1 &&
window.location.href.indexOf('flashback.org/sp') == -1)
return;
BDB som fungerar på alla bilder (dock en de som man måste vara vän med, måste vara inloggad):
Någon som kan göra någon snyggare kod? Denna hämtar alltid den rätta bilden.
Kod:
function fixBDB(linkUrl, imageId)
{
var imageUrl;
GM_xmlhttpRequest(
{
method: 'GET',
url: linkUrl,
onload: function(results)
{
try
{
var BDBdiv = document.createElement('iframe');
BDBdiv.innerHTML = results.responseText;
BDBdiv.style.display = 'none';
document.body.appendChild(BDBdiv);
var imgEl = document.getElementById('showContentImage');
imgEl = imgEl.lastChild.previousSibling.firstChild.nextSibling.firstChild.firstChild.firstChild;
imageUrl = imgEl.src;
if (!imageUrl)
{
imageUrl = linkUrl;
}
document.body.removeChild(BDBdiv);
var image = document.getElementById(imageId);
image.alt = imageUrl;
if (showImages)
{
image.src = imageUrl;
}
}
catch (e)
{
GM_log("Fel i BDB\n" + linkUrl + "\n" + e);
}
}
});
}
För att köra den ändrar man bdb-raden i getRealImageUrl(url, imageId) till detta (istället för fixImageLink(...):
Kod:
fixBDB(url, imageId);
För quikk.se:
Kod:
function fixQuikk(linkUrl, imageId)
{
try
{
imageUrl = linkUrl;
var image = document.getElementById(imageId);
image.alt = imageUrl;
if (showImages)
{
image.src = imageUrl;
}
}
catch (e)
{
GM_log("Fel i fixQuikk\n" + "\nID: " + imageId + "\n" + linkUrl + "\n" + e);
}
}
Samt i getRealImageUrl(), lägg till efter BDB-raden (sist).
Kod:
else if(url.match("quikk.se"))
{
fixQuikk(url, imageId);
}
ProcessImageLinks(), ersätt den gamla BDB-raden:
Kod:
currentAnchor.href.toLowerCase().match("bilddagboken.se/p/show.html?") ||
currentAnchor.href.indexOf('quikk.se/') != -1)
Fungerar iaf för mig. Dock så är BDB-länkar mycket sega att gå igenom, men den kommer alltid att visa rätt bild om den finns tillgänglig.