我試圖獲得一個相當簡單的腳本,它保留一個值並在GreaseMonkey:Scriptish的後繼中檢索它。GM_setValue未定義
瀏覽器:Firefox 9.0
Scriptish:0.1.7
在Windows 7旗艦版64位
// ==UserScript==
// @id testSerialization
// @name Test Serialization
// @version 1.0
// @namespace com.mobilvox.com
// @author
// @description
// @include http://www.google.com/
// @run-at document-end
// ==/UserScript==
GM_setValue("isCurrent", true);
GM_log("Is this script current? " + GM_getValue("isCurrent", false));
當我運行它,我得到:
[10:29:59.074] GM_setValue is not defined
@Scratchpad:29
@ Scratchpad:29
嘗試刪除元數據中的空白條目(在這種情況下爲'@ author'和'@ description')。損壞的或不正確的元數據塊有時會給出這種類型的錯誤(或用於)。確保元數據塊已滿,在文件中刷新 - 在前導'//'之前沒有空格或縮進。 –