Closed 2ge closed 3 years ago
Thanks for your suggestion, and sorry for the delay!
That's a nice idea, I use a bit of code magic* to do it myself, I can definitely add it to the extension, I just need to think about the UI / UX (what it should look like for the user, I don't think it should be fully automatic). If you have suggestions I'm all ears.
*Basically, I'm searching for elements with "Unsave" as text and click on them automatically.
I definitely need all Facebook items delete too! Pls, add this to your code.
@bouiboui could you share here your magic to delete all FB items? I have around 2k saved items and physically can't delete all of them manually :(
I have Facebook's new design now, old version was easier but I don't remember it.
It takes several steps:
Warning: All the items displayed on the page will be unsaved, permanently.
Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1).map(e => e.click())
Array.from(document.querySelectorAll('[role=menuitem]')).map(e => e.click())
Warning: All the items displayed on the page will be unsaved, permanently.
@bouiboui I've just shocked: can remove ~2k saved items no longer than 20 min with you help! Thank you so much! I'm going to integrate you solution in your plugin. Will try to create PR for your code...
That's nice, you can ask me anything if you need help.
I have Facebook's new design now, old version was easier but I don't remember it.
It takes several steps:
Warning: All the items displayed on the page will be unsaved, permanently.
- Scroll down to display all the links you want to unsave
- Run this in your console to open the contextual menu on each item:
Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1).map(e => e.click())
- Run this to click on "Unsave" on each of them:
Array.from(document.querySelectorAll('[role=menuitem]')).map(e => e.click())
Warning: All the items displayed on the page will be unsaved, permanently.
Sooo cool! Thank you for this!
facebook is blocking too fast requests, I am no JS master, but this works for me:
// 1) click links to see UNSAVE function
var links = Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1)
// Returns a Promise that resolves after "ms" Milliseconds
const timer = ms => new Promise(res => setTimeout(res, ms))
async function load () { // We need to wrap the loop into an async function for this to work
for (var i = 0; i < links.length; i++) {
console.log(links[i]);
links[i].click();
await timer(1100); // then the created Promise can be awaited
}
}
load();
//2) click on UNSAVE function
var links = Array.from(document.querySelectorAll('[role=menuitem]'))
// Returns a Promise that resolves after "ms" Milliseconds
const timer = ms => new Promise(res => setTimeout(res, ms))
async function load () { // We need to wrap the loop into an async function for this to work
for (var i = 0; i < links.length; i++) {
console.log(links[i]);
links[i].click();
await timer(1100); // then the created Promise can be awaited
}
}
load();
A lot of users are searching how to bulk delete saved items. For example I have 4500+ items in https://www.facebook.com/saved/ and there is no way how I can delete them, except to do it one by one. I think with small change of your great program you could save me another few hours of work...and not only me.