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:
@run-at parameterswindow.onload and unsafewindow.onloadCommands 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?