Sleazy Fork is available in English.

討論 » 建立請求

Facebook archive all messages

§
發表於:2019-03-28

Facebook archive all messages

Hello Everybody!

This is a simple script:

(function run() {
  let all = document.querySelectorAll('div[aria-label="Beszélgetésműveletek"]');
  if (all.length == 0) return;
  let a = all[0];
  a.click();
  setTimeout(() => {
    document.querySelectorAll('a[role=menuitem]').forEach(act => {
      if (act.innerText.match(/Archiválás/)) act.click();
    });
    run();
  }, 250);
})();

If the Facebook option is set to Hungarian, then with this script I can archive all messages at once when Messenger is open. I currently have to use the Developer Console to run it, I have to paste it into it, and then press an enter.

Set to Facebook in English, this is the correct code:

(function run() {
  let all = document.querySelectorAll('div[aria-label="Conversation actions"]');
  if (all.length == 0) return;
  let a = all[0];
  a.click();
  setTimeout(() => {
    document.querySelectorAll('a[role=menuitem]').forEach(act => {
      if (act.innerText.match(/Archive/)) act.click();
    });
    run();
  }, 250);
})();

I would like someone to write this to see a new button in Messenger, called Archive All. Solved?

wOxxOm管理員
§
發表於:2019-03-29
編輯:2019-03-29

FWIW you can save the code in devtools snippets - https://developers.google.com/web/tools/chrome-devtools/snippets - which can be later invoked using a mouse or keyboard (ctrl-shift-p, then type the snippet's name).

發表回覆

登入以回復