user3554962
user3554962

Reputation: 79

GM_getValue is causing a "deprecated" warning?

I saved a value using GM_setValue in a script using

GM_setValue ("foo", "bar");

A database is created - "save.db"

This is what I'm doing to read/alert the value of "foo" back using GM_getValue:

// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

var temp ;
temp = GM_log(GM_getValue("foo"));
alert(temp);

But, I got a Warning in the Error Console:

Warning: Use of getUserData() or setUserData() is deprecated. Use WeakMap or element.dataset instead.

If the stored value can't be read this way, what's the correct way of retrieving the value of "foo" back?

Upvotes: 0

Views: 283

Answers (1)

Brock Adams
Brock Adams

Reputation: 93473

Greasemonkey does not even use getUserData.

That error is not being caused by Greasemonkey. It is being caused by another extension -- probably AdBlock Plus. AdBlock Plus is known to have this problem.

You can tell which extension, or web-page code, is causing the problem by checking Firefox's error console (CtrlShiftJ).
Hover over the source link, on the right-hand side, or click the link to open the offending file. :
The error console shows where the error came from

The underlined part is the unique ID for AdBlock Plus. Every Firefox extension has a unique ID. Greasemonkey's is {e4a8a97b-f2ed-450b-b12d-ee082ba24781}.xpi

Upvotes: 1

Related Questions