Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

158
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda