Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GM_config is not defined #91

Closed
bab5470 opened this issue Apr 22, 2018 · 3 comments
Closed

GM_config is not defined #91

bab5470 opened this issue Apr 22, 2018 · 3 comments

Comments

@bab5470
Copy link

bab5470 commented Apr 22, 2018

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:

  • Member edited for adding code fence * Martii
@Martii
Copy link
Collaborator

Martii commented Apr 22, 2018

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
Copy link
Collaborator

Martii commented Jun 16, 2018

Closing for lack of reporter response.

@Martii Martii closed this as completed Jun 16, 2018
@jerry1333
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants