- Scrape & analyse all 19 internal APIs of train.jr-shikoku.co.jp/sp.html
using puppeteer + Chromium remote debugging
- Save live-captured sample JSON for every API endpoint under
lib/mockApi/mockData/ (station lists, lang, timetable, train positions, etc.)
- Add lib/mockApi/webviewXhrInterceptor.ts – generates a JS snippet that
overrides XMLHttpRequest inside the WebView before page scripts run;
intercepts /g?arg1=train&arg2=train (and optionally all static APIs)
returning mock data instead of the real server response
- Add lib/mockApi/index.ts – convenience re-exports + MOCK_TRAIN_POSITIONS
constant pre-populated with captured sample data
- Extend InjectJavascriptOptions with optional mockApiConfig field
- injectJavascriptData() prepends the interceptor JS when mockApiConfig is set
- TrainMenuContext gains mockApiEnabled / setMockApiEnabled and
mockTrainPositions / setMockTrainPositions state; consumers can enable
mock mode and inject custom TrainEntry[] without reloading the app
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Introduced useElesite hook for managing elesite data and settings.
- Added elesite logo asset.
- Updated types to include elesite data structures.
- Enhanced TrainMenuProvider to manage elesite usage settings.
- Implemented data fetching and caching for elesite information.
- Added utility functions to retrieve train information from elesite data.
- Introduced `stationData.ts` to store station information including names, numbers, and features.
- Created `trainIconMap.ts` for mapping train numbers to their respective image URLs, including dynamic URLs for special trains.
- Added `trainTypeConfig.ts` to define display settings for various train types, including colors and labels for different categories.