郎朗坤
2019-06-25 15:32:50
Gareemonkey 1.0中的jQuery與使用jQuery的網(wǎng)站沖突自從幾天前新的Gregemonkey 1.0發(fā)布以來(lái),所有jQuery的站點(diǎn)以及我在Gresemonkey腳本中使用jQuery的地方都不能正常運(yùn)行我的腳本。我在我的GS腳本中使用的jQuery(使用@require元數(shù)據(jù))與頁(yè)面的jQuery沖突。這要?dú)w功于新的@grant密碼。我已經(jīng)閱讀了這些文檔,但仍然不知道如何在沙箱中運(yùn)行GS腳本;唯一的選項(xiàng)似乎是授予對(duì)GS API的訪問(wèn)權(quán),或者將其授予None,然后在沒(méi)有任何安全限制的情況下運(yùn)行該腳本,當(dāng)我設(shè)計(jì)了幾十個(gè)具有安全限制的GS腳本并喜歡它時(shí),這一點(diǎn)對(duì)我來(lái)說(shuō)根本行不通。
3 回答

翻閱古今
TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超5個(gè)贊
this.$ = this.jQuery = jQuery.noConflict(true);
@grant
none
// @grant GM_addStyle// @grant GM.getValue// ==/UserScript==/*- The @grant directive is needed to work around a design flaws introduced in GM 1.0 and again in GM 4.0. It restores the sandbox. */
添加回答
舉報(bào)
0/150
提交
取消