Files
jrshikoku/docs/webinject-bookmarklet.md
harukin-expo-dev-env 67c706b1a3 Add support for generating WebInject bookmarklet
- Created a new documentation file for the WebInject bookmarklet usage.
- Implemented bookmarklet generation in the compile-web-script, encoding the JavaScript for safe URL usage.
- Updated the output log to include the generated bookmarklet file path and size.
2026-08-25 03:49:04 +00:00

1.3 KiB

走行位置 WebInject ブックマークレット

走行位置システム用の webViewInjectjavascript.ts を、通常のブラウザで実行できるブックマークレットとして生成します。

生成

npm run compile-web-script

生成物: webInjectJavascript.parsed.current.bookmarklet.txt

使い方

  1. https://train.jr-shikoku.co.jp/sp.html をブラウザで開き、ページの読み込みが完了するまで待つ。
  2. 上記ファイルの内容を、javascript: から末尾まで1行すべてコピーする。
  3. 新しいブックマークを作成し、URL欄へコピーした内容を貼り付ける。
  4. 走行位置ページを表示した状態で、そのブックマークを実行する。

ブックマークレットはコンパイルスクリプトの既定設定(東京UI、オリジナル列車アイコン、駅・列車メニュー無効)で生成されます。設定を変更したい場合は scripts/compile-web-script.tsoptions を変更して再生成してください。

ブックマークレットはReact NativeのWebViewブリッジを使わず、表示変更と外部APIの定期取得をブラウザ上で実行します。