I'm @require
-ing jQuery for my Greasemonkey script with this line in my script file:
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
and it works quite well; I can use $('#id')
to access the DOM.
However, the $
variable of the 'real' page is modified (where $
is jQuery 1.2.xx):
I get an error that $.include
is not defined.
I thought the sandbox model of Greasemonkey would prevent that the variables of the target-page are overwritten?
How can I ensure that the inclusion of javascript libraries does not affect the 'real' website, but only my Greasemonkey script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…