Skip to content

Instantly share code, notes, and snippets.

@lyndsysimon
Created July 29, 2020 16:35
Show Gist options
  • Select an option

  • Save lyndsysimon/e6a4a1becaddf09fe02c503793b545d6 to your computer and use it in GitHub Desktop.

Select an option

Save lyndsysimon/e6a4a1becaddf09fe02c503793b545d6 to your computer and use it in GitHub Desktop.

Revisions

  1. lyndsysimon created this gist Jul 29, 2020.
    27 changes: 27 additions & 0 deletions protonmail_archiver.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    /* 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);