Greasy Fork镜像 API

Get information from Greasy Fork镜像 and do actions in it.

< 腳本Greasy Fork镜像 API的回應

提問/評論

§
發表於:2023-08-28

Hi, first of all thanks for the script.

After I wanted to include the version 2.0 I get the following error.

Method: GreasyFork.getScriptData('xxxxxx').then(data => { [...]
Error:
Uncaught (in promise) ReferenceError: GM_xmlhttpRequest is not defined

I got it working for me as follows.

// @grant GM_xmlhttpRequest -> // @grant GM.xmlHttpRequest
GM_xmlhttpRequest({ -> GM.xmlHttpRequest({

According to information I found about this bug, the function was changed in version 4.0.
https://stackoverflow.com/a/54456646

If it is intended this way it might help someone else who also has this bug.

I am using Chrome 116.0.5845.111 with Tampermonkey v4.19.0

This is my first bug report on GreasyFork, sorry if I forgot anything.

§
發表於:2023-08-28

The same applys for the GM_openInTab -> GM.openInTab

NotYou作者
§
發表於:2023-09-02

Okay, got you, will update it right now.

Thanks for the bug report.

NotYou作者
§
發表於:2023-09-02
編輯:2023-09-02

Oh, actually, you just should add GM_xmlhttpRequest (or GM.xmlHttpRequest) to the @grants like so:

// @grant GM_xmlhttpRequest

or so:

// @grant GM.xmlHttpRequest

P.S.: Don't forget to update to the last version of Greasy Fork镜像 API.

NotYou作者
§
發表於:2023-09-02

And also GM.openInTab as well!

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址