This is a TamperMonkey userscript. Why doesn't "HELLO" popup? I am running Google Chrome on Ubuntu.
// ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match http://*/* // @match https://*/* // @grant none // ==/UserScript== window.addEventListener("DOMContentLoaded", function(event) { alert("HELLO"); });
document, notwindow.alert("HELLO");works.// @run-at document-startto your header will help, check out the specification for more details