Comments (6)
不觉得Mozilla对GM能有什么控制吧…
个人暂时准备换用TM,毕竟Chrome那边一直在用,UI完爆GM/VM,而且最近支持跨浏览器同步了
from scripts.
所以我說那個為什麼會失效……
有沒有新版 GM 的改動列表
from scripts.
@binotaliu https://github.com/greasemonkey/greasemonkey/milestone/74?closed=1 Milestone
@fireattack we 版的油猴外观还行。目前的问题还是架构变化导致部分功能函数在现有的基础上难以实现。
from scripts.
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.
新版 API 有 polyfill
from scripts.
for further discussion or issues with certain script, you're welcome to open new issue.
需要進一步討論或特定腳本的問題,可以開新 Issue。
from scripts.
Related Issues (20)
- 添加写入权限给 [Liaune] HOT 5
- 添加黄油助手坏了 HOT 5
- bgm-eps-editor.min.user.js批量编辑音乐条目格式错误 HOT 3
- 添加写入权限给inchei HOT 1
- 站内脚本插件中心的提议
- 添加黄油助手不能正确抓取人物信息 HOT 1
- 添加写入权限给 Trim21 HOT 1
- 添加写入权限给 willian HOT 1
- 添加写入权限给 infinityloop HOT 1
- 添加写入权限给 [[313469]] HOT 1
- bangumi_domain_redirector.user.js https问题
- 添加写入权限给 [[vickscarlet]] HOT 1
- 添加写入权限给 [[11896]] HOT 2
- 添加写入权限给 ychz HOT 1
- 添加写入权限给【shichimiyasaton}}}}}
- 添加写入权限给 neutrinoliu HOT 1
- 添加写入权限给 [[eien]] HOT 1
- 添加写入权限给 [xiaoyvyv] HOT 1
- 添加写入权限给 [NeKoOuO] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.