搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Greasemonkey Script does not work - please help!

  • 14 回覆
  • 1 有這個問題
  • 744 次檢視
  • 最近回覆由 mvlsports

more options

I am trying to use a script to play GoalLineBlitz and the script worked on previous versions of Firefox but does not currently work. Are there settings that I need to change within Firefox? I do not want to revert back to old versions of Firefox, but my I am tempted to do so.

If needed, I could share the script, but the script worked previously, so I am not sure that would be an issue now.

Here is a link to the script: https://greasyfork.org/en/scripts/3424-rockitsauce-glb-game-scout-tool/code

由 mvlsports 於 修改

被選擇的解決方法

Seems you may need to get rid of "for each ( x in y )" for Firefox 57+:

https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for_each...in

Does this work? Replace:

	var saved = [];
	for each (var val in GM_listValues()) {
		saved.push(val);
	}

with

	var saved = GM_listValues();

https://github.com/scriptish/scriptish/wiki/GM_listValues

從原來的回覆中察看解決方案 👍 1

所有回覆 (14)

more options

Hi, would not know as Mozilla ok's Developers Extensions for use with Firefox and supplies them a web page to distribute it from. The Developers have their own Support and Contact Which is on this page of theirs : https://addons.mozilla.org/firefox/addon/greasemonkey/ There have been a couple people with issues in the last few days with Greasemonkey. It was just updated 2 days ago to version 4.5

You can Copy/Paste about:addons to the Address Bar then Enter and go to the gear icon in the top right of the page and click and then click to update Extensions.

Some people use : https://addons.mozilla.org/firefox/addon/violentmonkey/ https://addons.mozilla.org/firefox/addon/tampermonkey/

Please let us know if this solved your issue or if need further assistance.

由 Shadow110 於 修改

more options

Thanks, I tried both violentMonkey and tamperMonkey and had no luck. I think there may be issues with the permissions?

https://developer.mozilla.org/en-US/Firefox/Privacy/Tracking_Protection

more options

I can see from this --

// @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_listValues

-- that the script hasn't been updated to run with Greasemonkey 4.x: the author renamed these methods. Either Violentmonkey or Tampermonkey is more backwards compatible and would have a better shot at running the script.

more options

Do the URLs in the script match the current game URLs?

// @include http://glb.warriorgeneral.com/game/game.pl?game_id=*&mode=pbp // @include http://glb.warriorgeneral.com/game/scout_team.pl?team_id=*

more options

Woud Ad Blocker Plus run any interference? I am going to remove GreaseMonkey completely and try to do TamperMonkey again.

more options
more options

I am getting a parsing error!

"unexpected token each"

more options

Hey, wait a minute! Not sure what I did but the script is working now. I mess around with the code a little and got it to work! Thanks a ton for your help. The script is working with TamperMonkey.

more options

It worked for one game but is not working now! Dang it.

more options

Unfortunately, the script's developer doesn't appear to be active (scripts were last updated four years ago). You still could try posting a discussion on the script to see whether there is a known issue.

more options

Thanks. I think I will try to do some incremental debugging as I was able to get the script to work temporarily. I think I might know where the issues lies within the script itself.

more options

I got it to process. It does not finish as it should though. Data is listed below my screen shot and appears to be good.

The parse error is coming from the for each. When I take the each out, that is where the issues are after the script is processed. It does allow the script to process though.

由 mvlsports 於 修改

more options

選擇的解決方法

Seems you may need to get rid of "for each ( x in y )" for Firefox 57+:

https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for_each...in

Does this work? Replace:

	var saved = [];
	for each (var val in GM_listValues()) {
		saved.push(val);
	}

with

	var saved = GM_listValues();

https://github.com/scriptish/scriptish/wiki/GM_listValues

more options

Thank you both so much for your help. I used TamperMonkey and made the changes in the code as recommended and the script is now fully functioning!