Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda