Created
July 29, 2020 16:35
-
-
Save lyndsysimon/e6a4a1becaddf09fe02c503793b545d6 to your computer and use it in GitHub Desktop.
Protonmail inbox cleaner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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); |
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
EDIT: Removed code in this comment, forked and updated the scripts here: https://gist.github.com/apazzy/33af2c32e066ae8e6c0a9c224ebdf72b
@apazzy Thank you!
Sorry for the very late reply; I no longer regularly use GitHub. My employer uses Gitlab for their projects, and I've migrated my active stuff to Sourcehut.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm unfortunately getting error messages trying to run this with chromium. Thanks for making it though.