Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
How can I refresh the ProtonMail web inbox page once with Tampermonkey?

I have multiple ProtonMail accounts, and am trying to add an avatar to replace the default first letter of my name in the upper right hand corner of the ProtonMail web interface so I can more easily differentiate which inbox I'm in, like this:

enter image description here

I've worked out the Tampermonkey script below that loads images from my localhost server (on OS X; this could easily load images from imgur, etc.) according to the email address in the browser location bar, and that works.

The issue is that the images only show after I force reload the page once.

Is it possible to force a reload of the page once via Tampermonkey using jQuery or Javascript?

I can't simply use location.reload(); in the script, as that will refresh over and over; I only need to refresh the page once after the inbox loads.

Or is there another way to get the avatars to show on first page load?

// ==UserScript==
// @name         ProtonMail Avatars
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  ProtonMail Avatars
// @author       Me
// @match        https://mail.protonmail.com/*
// @icon         
// @require      https://code.jquery.com/jquery-3.4.1.min.js
// @grant        GM_addStyle
// ==/UserScript==

/* globals jQuery, $, waitForKeyElements */

jQuery(document).ready(function() {
 $(window).bind("load", function() {

  var term = document.title;
  var email1 = "email1@protonmail.com";
  var email2 = "email2@protonmail.com";

  if (term.indexOf(email1)!= -1) {
   $(".user-initials span").css("display","none");
    $(".user-initials").css('background-image','url(http://localhost/email1.png)');
}

 if (term.indexOf(email2)!= -1) {
  $(".user-initials span").css("display","none");
   $(".user-initials").css('background-image','url(http://localhost/email2.png)');
}

 });
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!