URL Protocol
About 448 wordsAbout 1 min
2025-11-29 13:02:57
1. Overview
SecScore provides a custom URL protocol so you can trigger actions from a browser, command line, or other apps.
Scheme:
secscoreBasic format:
secscore://<command>[/<subcommand>]Case rules:
- The scheme and command are case-insensitive (
SecScore://settingsequalssecscore://SETTINGS) - Recommended: use lowercase consistently
- The scheme and command are case-insensitive (
Behavior:
- If SecScore is not running: start the app and execute the URL action
- If SecScore is already running: forward the URL to the existing instance (no second instance)
2. Navigation URLs
Open the main window and navigate to a specific page.
2.1 Home
URLs:
secscore:// secscore://homeBehavior:
- Open the main window and navigate to
/(home)
- Open the main window and navigate to
2.2 Students
URL:
secscore://studentsBehavior:
- Open the main window and navigate to
/students
- Open the main window and navigate to
2.3 Scoring
URL:
secscore://scoreBehavior:
- Open the main window and navigate to
/score
- Open the main window and navigate to
2.4 Leaderboard
URL:
secscore://leaderboardBehavior:
- Open the main window and navigate to
/leaderboard
- Open the main window and navigate to
2.5 Settlements
URL:
secscore://settlementsBehavior:
- Open the main window and navigate to
/settlements
- Open the main window and navigate to
2.6 Reasons
URL:
secscore://reasonsBehavior:
- Open the main window and navigate to
/reasons
- Open the main window and navigate to
2.7 Settings
URL:
secscore://settingsBehavior:
- Open the main window and navigate to
/settings
- Open the main window and navigate to
3. Floating Sidebar Control
Control the global floating sidebar window (global-sidebar).
3.1 Show sidebar
URL:
secscore://sidebar/showBehavior:
- If it exists: call
show()+focus() - Otherwise: create the
global-sidebarwindow and show it
- If it exists: call
3.2 Hide sidebar
URL:
secscore://sidebar/hideBehavior:
- If it exists: call
hide() - Otherwise: do nothing
- If it exists: call
3.3 Toggle
URLs:
secscore://sidebar/toggle secscore://sidebarBehavior:
- If it exists:
- Visible → hide
- Hidden → show and
focus()
- Otherwise: create and show the
global-sidebarwindow
- If it exists:
4. Examples (Windows)
4.1 Run dialog (Win + R)
Input:
secscore://settings
secscore://sidebar/toggle4.2 Browser address bar
Input:
secscore://score4.3 Command line
start "" "secscore://leaderboard"5. Install & Registration (Packaged Builds)
This section targets packaged installers. In dev mode (
pnpm dev), the protocol may not be registered automatically.
- The registration config is in
tauri.conf.json:scheme:secscorename:SecScore URL Protocol
- After installation, the OS will dispatch
secscore://URLs to SecScore.
6. Errors & Compatibility
All URLs are local triggers; no network transmission.
The current protocol only supports page-level navigation and floating sidebar control, with no parameters (e.g. student ID).
Unknown commands (for example):
secscore://unknownare ignored without showing an error dialog.
7. Future Extensions
You can extend the protocol while keeping backward compatibility, for example:
Open scoring for a specific student:
secscore://score/12345Filtered leaderboard view:
secscore://leaderboard/today
This only requires adding new branches in the main-process URL parsing logic.
Contributors
Changelog
388c1-feat(docs): 更新导航和新增功能文档on
Copyright
Copyright Ownership:SECTL
License under:CC BY-NC-SA 4.0