GMCommonAPI.js

GM Common API (GMC) is a simple library designed for easily adding Greasemonkey 4 compatibilty to existing userscripts

2017-10-25 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/34527/226133/GMCommonAPIjs.js을(를) 사용하여 포함하는 라이브러리입니다.

작성자
Stig Nygaard
버전
0.0.1.20171025175439
생성일
2017-10-25
갱신일
2017-10-25
크기
13.4KB
라이선스
해당 없음

GM Common Library (GMC) is an API designed for easily adding Greasemonkey 4 compatibilty to existing userscripts.

GMC provides a common subset of the functionality offered by the new "asynchronized API" in Greasemonkey 4 (GM.*) and the classic "synchronized API" from other userscript managers (GM_*), offered in a single "classic" synchronized API (GMC.*).

With the introduction of the Greasemonkey 4 WebExtension (currently in beta [todo: link]), the classic GM_* "synchronious" API is replaced with a new GM.* "asynchronious API". The features of the new API in Greasemonkey 4 (GM4) are very similar to the classic API, but the functions are asynchronious. This means you might need to (learn asynchronious programming and) do some refactoring of your existing userscripts to make use of the new GM4 API.

As an alernative to refactoring your code, GMC offers a "synchronious subset" of the GM APIs, which works with both scripts running in the new GM4, in the older versions of Greasemonkey, and in other userscript managers (Tampermonkey, Violentmonkey etc). Where APIs are supported in GMC, no refactoring of your script is needed; Simply [todo: add GMC script/grants and] replace the use of GM_* methods in your script with equialent GMC.* methods.

For more info, see GitHub [todo: link] or source code.