0
我有一个关于用户脚本的问题。在主函数initiateFlasher之前或之后是否更快?性能userscript注入代码
if (typeof unsafeWindow !== 'undefined' && unsafeWindow.jQuery) {
initiateFlasher(unsafeWindow.jQuery);
} else {
function addScript(callback) {
var script = document.createElement('script');
script.text = '(' + callback.toString() + ')();';
document.body.appendChild(script);
}
addScript(initiateFlasher);
}
function initiateFlasher(arg) {}
谢谢!我看到它在Safari控制台中抱怨initateFlasher()没有先定义。 – Anteus