-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ A little refactor
- Loading branch information
Showing
27 changed files
with
794 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 4, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"arrowParens": "always", | ||
"bracketSameLine": true, | ||
"bracketSpacing": true, | ||
"printWidth": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div align="center"> | ||
|
||
<img alt="logo" src="./assets/chibi.png" width="200px"> | ||
|
||
# Chibi (チビ) | ||
|
||
#### とあるユニバーサル Scratch 拡張機能ローダーです。 | ||
|
||
</div> | ||
|
||
--- | ||
|
||
Chibi は Tampermonkey/GreasyMonkey に対応するユーザースクリプトであり、「どのエディターでも拡張機能が使える」という仕様が搭載されています(理論的に)。 | ||
|
||
# ✨ 仕様 | ||
|
||
- [X] 標準 Scratch 拡張機能をロードできる | ||
- [X] Unsandboxed 拡張機能をロードできる | ||
- [X] どこでも Turbowarp 専用機能を使える (一部) | ||
- [ ] 拡張機能をインストールしなくでもサードパーティー拡張機能を搭載したプロジェクトを起動できる | ||
- [X] 直接的にエディターから拡張機能をロードできる | ||
|
||
# 🌈 プラットフォーム | ||
|
||
- [X] Scratch | ||
- [X] CodingClip | ||
- [X] Cocrea | ||
- [X] Aerfaying | ||
- [X] Co-Create World | ||
- [X] XMW | ||
- [X] CodeLab | ||
- [X] 40code | ||
- [X] TurboWarp | ||
|
||
# 🔥 使い方 | ||
|
||
1. Tampermonkey / Greasymonkey をインストールします。 | ||
2. [リリースページ](https://github.com/SimonShiki/chibi/releases)を開き、バージョンを選択してインストールします。 | ||
3. 'ブロック定義'のカテゴリーで、'Open Frontend' が現れます。クリックすると拡張機能をサイドロードできます。(都合により、およそ5秒のラグがあります) | ||
|
||
> うん…エディターによって、ボタンが正常に現れない場合もあります。その時は DevTools で拡張機能をロードできます。 | ||
1. 'Ctrl + Shift + J' (Windows) / 'Cmd + Opt + J' (MacOS) で DevTools を開きます。 | ||
2. コンソールで ``chibi.openFrontend()`` や ``chibi.loader.load([extensionURL], [load mode, like 'unsandboxed'])'``を実行します。 | ||
3. これで完成。 | ||
|
||
# 🥰 拡張機能の投稿 | ||
|
||
Chibi のダッシュボードには拡張機能のギャラリーがあります。どうぞ自由に好きな拡張機能を使ってください。 | ||
|
||
もし良かったら [moth](https://github.com/SimonShiki/moth) で自分の一番好きな拡張機能を投稿してください。 | ||
|
||
# ⚓ ライセンス | ||
|
||
AGPL-3.0 です。詳しくは[こちら](./LICENSE)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[简体中文](./README-zh_CN.md) | ||
[简体中文](./README-zh_CN.md) [日本語](./README-ja_JP.md) | ||
|
||
<div align="center"> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import { trap, inject } from './injector/inject'; | ||
import { log } from './util/log'; | ||
|
||
const open = window.open; | ||
// @ts-expect-error defined in webpack define plugin | ||
log(`Chibi ${__CHIBI_VERSION__}`); | ||
await trap(); | ||
// Try injecting chibi into the page. | ||
await trap(open); | ||
if (typeof window.chibi.vm !== 'undefined') { | ||
// Alright we got the virtual machine, start the injection. | ||
inject(window.chibi.vm); | ||
} else { | ||
// This is not a Scratch page, stop injecting. | ||
log(`Cannot find vm in this page, stop injecting.`); | ||
} |
Oops, something went wrong.