Adds a download button to Bluesky images and videos. Built off coredumperror's script with a few improvements.
< Opinie na Bluesky Image Download Button
Its info is possibly stored in the js object, generated by vue or similar thing
I'm not familiar to this too
Take one of my script for example, I got the path of target id
from a classless div by brute force search the source code in console debugger
let cards = document.querySelectorAll("div[data-v-485ecbd6]:has(>.card):not(.fixedLink)");
let id = card?.__vue__.$vnode.componentOptions.propsData.card.mblog.id;
Oh jeez, that's a hell of a work around. I'll look around to see if there's something like that I can do. I really don't want to keep coming back to update selectors just because they decided to add another empty div randomly to their hierarchies.
targetNode = node.querySelector(".r-13awgt0:has(> .r-1d5kdc7)");
Still relies on the obfuscated classnames, and isn't as performant as a stricter selector, but seems to work for now.
I'm currently testing '[data-testid="followingFeedPage-feed-flatlist"]'
and it seems to be a safe one.
I found a really silly way to do it and I hate it, but here it goes into the 1.4 code :)
targetNode = $(node).find('[data-testid$="-flatlist"]').get(0);
headerNode = node.querySelector('[href="/settings"]');
if (targetNode && !targetSpotted) {
imgObserver.observe(targetNode.parentElement.parentElement.parentElement.parentElement.parentElement,config);
targetSpotted = true;
}
if (headerNode && !headerSpotted) {
headerNode = headerNode.parentElement;
On v1.4, filenaming button being located in left menu above profile picture makes it not usable if the window is small which collapses the left bar. See attached image. Tradeoff between this and it being always accessible I guess. Could alternatively just remain only in the account page where it was before.
Also the v1.4 targetNode selector doesn't work for individual post pages, e.g. https://bsky.app/profile/96yottea.bsky.social/post/3l6ytr3bbh42b. v1.1 seemed to work for every page type, unless I missed something.
Thanks for making me an author! But I don't think that lets me contribute directly without making another fork, unless I'm missing something. I don't have an "Update" tab on greasyfork like I do with scripts that I create myself.
On v1.4, filenaming button being located in left menu above profile picture makes it not usable if the window is small which collapses the left bar. See attached image. Tradeoff between this and it being always accessible I guess. Could alternatively just remain only in the account page where it was before.
I'll move it somewhere else, also just realized I made this unnecessarily complex.
Sounds good. Btw I figured out the author thing, missed the associated email.
v1.5 is out, opinions?
Seems great! New location for Filenaming makes sense.
I see a minor "conflict" with the Imagus extension - adds a non-functional download button to very top left when I hover an image with it. If I get around to patching that for myself I'll push it here.
If anyone can tell me a better way to do lines 95 and 96, I'm all ears. I hate the stupid obfuscation methods modern sites use.