Created
March 25, 2010 08:13
-
-
Save yoko/343304 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gresemonkey localStorage Test | |
// @namespace http://codefairy.org/ns/userscripts | |
// @include * | |
// ==/UserScript== | |
GM_log(typeof unsafeWindow.localStorage); // object | |
GM_log(unsafeWindow.localStorage.num = Number(unsafeWindow.localStorage.num || 0) + 1); // OK! | |
GM_log(typeof window.localStorage); // object | |
GM_log(window.localStorage.num = Number(window.localStorage.num || 0) + 1); // NG! "Component is not available" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment