Giter Club home page Giter Club logo

Comments (6)

fireattack avatar fireattack commented on May 30, 2024

不觉得Mozilla对GM能有什么控制吧…

个人暂时准备换用TM,毕竟Chrome那边一直在用,UI完爆GM/VM,而且最近支持跨浏览器同步了

from scripts.

 avatar commented on May 30, 2024

所以我說那個為什麼會失效……
有沒有新版 GM 的改動列表

from scripts.

ershiwo avatar ershiwo commented on May 30, 2024

@binotaliu https://github.com/greasemonkey/greasemonkey/milestone/74?closed=1 Milestone
@fireattack we 版的油猴外观还行。目前的问题还是架构变化导致部分功能函数在现有的基础上难以实现。

from scripts.

 avatar commented on May 30, 2024

Greasemonkey 4 For Script Authors

有幾個方法不再支持

As of today, there is no support for: GM_log (use console.log), GM_addStyle, GM_registerMenuCommand, nor GM_getResourceText.

其他方法應該是改為 async (返回 Promises),並且放到 GM Object 下,

There is only one object provided to user scripts now, named GM. It has several properties. One of them is info – the equivalent of the old GM_info. There are also several methods of this object: getResourceUrl, deleteValue/getValue/listValues/setValue, xmlHttpRequest.

文中也提到可以直接使用 await

console.log('Starting the get/set demo ...');
let i = await GM.getValue('i', 0);
console.log(`This time, i was ${i}.`);
GM.setValue('i', i+1);

Here the GM.getValue() method actually returns a promise, but the await keyword transparently converts that to its resolved value, allowing us to write code just as if the value was directly returned – with neither callbacks nor promise resolution.


感覺除了 addStyle 以外,大部分的方法都可以兼容吧

from scripts.

FranklinYu avatar FranklinYu commented on May 30, 2024

新版 API 有 polyfill

from scripts.

 avatar commented on May 30, 2024

for further discussion or issues with certain script, you're welcome to open new issue.

需要進一步討論或特定腳本的問題,可以開新 Issue。

from scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.