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

435
Vistas
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 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