sizzlemctwizzle / GM_config

A lightweight, reusable, cross-browser graphical settings framework for inclusion in user scripts.
https://github.com/sizzlemctwizzle/GM_config/wiki
GNU Lesser General Public License v3.0
205 stars 48 forks source link

GM_config is not defined #91

Closed bab5470 closed 6 years ago

bab5470 commented 6 years ago

I am trying to migrate my tamper monkey script from vivaldi over to firefox. Upon doing so I am getting a warning for every call to GM_Config reference in my script indicating GM_config is not defined.

I've read that can happen if the "require" statement is added to the script after the script is created but I've reset firefox, re-installed tampermonkey, redownloaded my script from greasyfork (i'm not even trying to manually create it)

Despite doing so I am still getting this error. I am running tampermonkey 4.6.5757 on firefox 59.0.2 if that matters.

I noticed this version of tamper monkey seems to be a lot more pedantic about small issues (like spacing). So I don't know if there's something else I need to do to make it recognize gm_config. Here's what I have at the top of my script:

// ==UserScript==
// @name         My tamper monkey script
// @namespace    http://www.mywebsite.com
// @version      0.3
// @description  Description of my script
// @author       My Name
//
// @match      *://www.tumblr.com/*
//
// @noframes
//
// @require https://openuserjs.org/src/libs/sizzle/GM_config.js
// @require https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// @require http://code.jquery.com/jquery-latest.js
//
// @grant    GM_addStyle
// @grant    GM_listValues
// @grant    GM_setValue
// @grant    GM_getValue
// @grant    GM_deleteValue
// @grant    unsafeWindow
// @grant    GM_registerMenuCommand
//
// @run-at document-end
//
// ==/UserScript==

GM_config.init({  <-- this is where it gives me a warning about GM_config being not defined

NOTE:

Martii commented 6 years ago

tampermonkey 4.6.5757 on firefox 59.0.2 if that matters.

Shouldn't but is quite helpful to know as most of the engines have some issues right now with Fx since it has severe growing pains... that's what I have in one profile.

Try viewing the script source at https://openuserjs.org/scripts/Marti/OUJS-1 for some hints (it's pretty simple at the moment and I do release with undefined the default created GMC object but that's trivial) and test it in your browser... it should work when you are logged in. You should see the OUJS-1 header at https://openuserjs.org/user/preferences . (sidenote looks like my CSS needs tweaking even more now LOL).

Martii commented 6 years ago

Closing for lack of reporter response.

jerry1333 commented 3 years ago

Since its warning probably You should use: /* globals $, GM_config */