Closed qsniyg closed 3 years ago
I can't see it mentioned in the documentation, but it does support both.
I couldn't see it in their documentation and it is not open source any more.
This repository contains the source of the Tampermonkey extension up to version 2.9. All newer versions are distributed under a proprietary license.
https://github.com/Tampermonkey/tampermonkey
Our extension uses Google Analytics, a web analysis service from Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043 USA, hereinafter referred to as “Google“. Google Analytics employs so-called “cookies“, text files that are stored to your computer in order to facilitate an analysis of your use of the site.
For technical reasons (i.e. when the BlackCheck service checks for updates), data such as the following, which your internet browser transmits to us or to our web space provider (so called server log files), is collected: type and version of the browser you use operating system websites that you visit date and time of your visit your Internet Protocol (IP) address.
Partial compatibility has been implemented. Please note:
GM_getValue
& GM_listValues
immediately will get the values at the start of the session which is the browser start-up time or script enabled time, whichever laterGM_getValue
& GM_listValues
on an event
will get the values at page load timeThe async GM.getValue
& GM.listValues
will get the values at that moment.
v2.0 released
v2.43 uploaded
Added experimental sync storage compatibility
Just checked this and it doesn't appear to be working for GM_deleteValue
:
// ==UserScript==
// @name FireMonkey Sync Storage Test
// @version 0.0.1
// @namespace firemonkey-test
// @include *
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_listValues
// @grant GM_setValue
// ==/UserScript==
const KEY = 'test'
const VALUE = 42
const stored = Object.fromEntries(GM_listValues().map(key => [key, GM_getValue(key)]))
console.log('stored:', stored)
if (GM_getValue(KEY)) {
GM_deleteValue(KEY)
console.log(`deleted ${KEY}:`, GM_getValue(KEY) === undefined)
} else {
GM_setValue(KEY, VALUE)
console.log(`set ${KEY}:`, GM_getValue(KEY) === VALUE)
}
console.log('test:', GM_getValue(KEY))
stored: { }
set test: true
test: 42
stored: { test: 42 }
deleted test: true
test: undefined
stored: { }
set test: true
test: 42
stored: { test: 42 }
deleted test: false
test: 42
I will check it. It might be related to (and fixed via) the issue #491
I checked and it is related to issue listed above and should be fixed in v2.57
GM_getValue/GM_setValue are synchronous:
Looking at the source code (scriptAPI.js), it appears
GM_setValue
is just mapped directly toGM.setValue
:I'm not sure if GM_setValue needs to be changed, but
GM_getValue
returning a promise prevents some userscripts (including mine) from properly working. I'm guessingGM_listValues
should also be synchronous.Thank you for doing this by the way, it's great to have more options :)