Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Protonmail inbox cleaner
/* Lyndsy's Protonmail mass archiver
*
* This is a simple script that marks all emails in a folder as
* read and archives them.
*
* I wrote it to work against the Protonmail Beta interface:
* https://beta.protonmail.com
*
* Usage:
* - Navigate to your inbox (or another folder, presumably)
* - Open your browser's developer tools' Javascript console
* - Paste in this script
* - Go get a cup of coffee; or maybe just go to bed if you have
* as many unread emails as I did :)
*/
let markAsRead = function() { $('a.pm-group-button')[0].click() };
let selectAll = function() { $("#selectAll").click() };
let archive = function() { $('button[data-action=archive]').click() };
function markAsReadAndArchive() {
selectAll();
setTimeout(markAsRead, 1000);
setTimeout(archive, 3000);
}
setInterval(markAsReadAndArchive, 10000);
@t2na

This comment has been minimized.

Copy link

@t2na t2na commented Jun 10, 2021

I'm unfortunately getting error messages trying to run this with chromium. Thanks for making it though.

@t2na

This comment has been minimized.

Copy link

@t2na t2na commented Jun 10, 2021

Uncaught ReferenceError: $ is not defined
at selectAll (:2:30)
at markAsReadAndArchive (:6:3)
at r (helpers.ts:87)
selectAll @ VM79:2
markAsReadAndArchive @ VM79:6
r @ helpers.ts:87
setInterval (async)
(anonymous) @ trycatch.ts:119
(anonymous) @ VM79:11
instrument.ts:158 POST https://mail.protonmail.com/api/reports/sentry/api/9/store/?sentry_key=64982c67a00b4e68833169e2c4f26819&sentry_version=7 net::ERR_BLOCKED_BY_CLIENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment