我正在尝试创建一个动态 GM 脚本。这是我认为会做的
win = window.open('myScript.user.js');
win.document.writeln('// ==UserScript==');
win.document.writeln('// @name sample script');
win.document.writeln('// @description alerts hi');
win.document.writeln('// @include http://www.google.com/*');
win.document.writeln('// ==/UserScript==');
win.document.writeln('');
win.document.writeln('(function(){alert("hi");})()');
win.document.close();
好吧,它没有。任何人都知道如何去做这件事?