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

434
Visualizações
Tampermonkey script not firing on web app using websockets

I use GM/TM scripts extensively and they work without fail except on one site: a Slack-style enterprise chat tool, Mattermost. The page loads, opens a websocket, then fetches the chat pane content and populates it.

As a test, I've used the most basic logic to just print a message to the console. The script applies to the entire domain and is shown as active, but no errors or logs are emitted.

// ==UserScript==
// @name         mattermost
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://*.cloud.mattermost.com/*
// @grant  none
// ==/UserScript==

console.log("test")

Approaches I have tried:

  • Using various @run-at parameters
  • Using waitForKeyElements, which usually works on sites loading in dynamic content
  • Adding a timeout before firing
  • Various invocations of window.onload and unsafewindow.onload

Commands issued directly to the console after the page has loaded in its entirety work, and the DOM can be manipulated at will. Is there some caveat I am missing here when it comes to websockets?

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