討論 » 開發

solved: RawGit based @require no allowed by greasy fork

§
發表於:2017-03-02
編輯:2017-03-03

solved: RawGit based @require no allowed by greasy fork

Hi all,

on the GF rules page "RawGit (commit-specific URLS only)" is allowed for @require, but what does "commit specific URLS only" means? only a fixed version of a file or whitelisted URLS?

I include "@require https://cdn.rawgit.com/gnadelwartz/GM_config/0e4b1e4c/GM_config-min.js" and this worked in my dev environment, but I can't upload to greasy fork.

Does anyone know how to change the link to meet the GF requirements for RawGit?

woxxom管理員
§
發表於:2017-03-02

Summoning @JasonBarnabe.

§
發表於:2017-03-03

hi,

I found the answer myself: you have to include the commit hash in the url. This is because this is the only way to be shure the correct version of the file is included!

https://cdn.rawgit.com/gnadelwartz/GM_config/0e4b1e4c0dd6b08499082c679850ebc0f56e6ca4/GM_config-min.js

how to get this url?

open the file in github and klick on the file, then on the commit hash you want to refer to, then browse file, then klick on the file.

now the correct file is shown and you can copy the URL and paste on rawgit.com to get the final cdn url.

woxxom管理員
§
發表於:2017-03-03

You can also press y key to switch the currently displayed URL to a commit-specific URL. Github has many shortcuts which you can see after pressing ? key.

發表回覆

登入以回復