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

433
Views
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
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!