这是一个TamperMonkey userscript。为什么不打开“HELLO”?我在Ubuntu上运行Google Chrome。TamperMonkey userscript不会触发DOMContentLoaded事件
// ==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',not'window'](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)。 –
我刚试过,仍然无法使用。 –
作为比较的基础,只是做'alert(“HELLO”);'工作。 –