いいえ、それらは衝突できません。私はGreasemonkeyの実行モデルの詳細についてはっきりしていませんが、私はテストを行いました。 は、私はボタンをクリックするとlodashを使用して、このHTMLファイルを作成:
// ==UserScript==
// @name Test greasmonkey overriding
// @namespace gm-overriding
// @version 1
// @grant none
// ==/UserScript==
_ = null
console.log("here is _:", _);
:私も削除userscript、_を作成し
<html>
<head>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.13.1/lodash.min.js'></script>
</head>
<body>
<input type='button' id="btn" value="Invoke lodash">
<script type="text/javascript">
\t el = document.getElementById("btn")
\t el.addEventListener('click',function (argument) {
\t \t console.log("3 =", _.add(1,2));
\t })
</script>
</body>
</html>
userscriptはではなくがlodash依存関係に影響し、ボタンのクリックは依然として予想される出力を出力します。
出典
2016-07-12 16:16:54
aom
テストに欠陥があり、結論が不正確です。スクリプトはいつもお互いに、そしてページと常に干渉しています。 [ここには1つのクラスの例があります](http://stackoverflow.com/questions/12146445/jquery-in-greasemonkey-1-0-conflicts-with-websites-using-jquery)。 ...あなたのテストスクリプトで、 'window._ = null;'を使って何が起こるのかを見ます。 –