CtrlK
BlogDocsLog inGet started
Tessl Logo

1k-browser-module

OneKey Browser/Discovery development for WebView tabs, bookmarks, history, search, URL risk checks, DApp connections, and JSBridge behavior.

72

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Browser Module

Use this for desktop/mobile Discovery Browser and MultiTabBrowser work: WebView lifecycle, DApp connections, bookmarks/history, search, URL validation, and analytics.

Quick Reference

TopicGuideKey Files
Module mapmodule-map.mdpackages/kit/src/views/Discovery/, packages/kit-bg/src/services/ServiceDiscovery.ts
Tabs and navigationtabs-navigation.mdpackages/kit/src/states/jotai/contexts/discovery/
WebView and securitywebview-security.mdpackages/kit/src/views/Discovery/components/WebContent/
DApp connectiondapp-connection.mdpackages/kit-bg/src/services/ServiceDApp.ts, packages/kit/src/views/DAppConnection/
Data, search, bookmarksdata-search-bookmarks.mdServiceDiscovery.ts, useSearchModalData.ts, SimpleDB browser entities
Testing and reviewtesting-review.md*.test.ts, *.test.tsx, discovery logger scenes

Default Workflow

  1. Identify the enabled platform surface: native mobile Discovery tab or desktop MultiTabBrowser.
  2. Read module-map.md, then open only the rule file matching the requested change.
  3. Trace state through useBrowserTabActions, useBrowserAction, and ServiceDiscovery before UI edits.
  4. Preserve platform-specific files: .native.tsx, .desktop.tsx, .ext.tsx, and unsuffixed fallbacks have different behavior.
  5. Treat extension/web paths as fallback or shared infrastructure unless the request explicitly enables browser behavior there.
  6. Verify URL validation, deep link handling, DApp provider notifications, and persisted SimpleDB data are still coherent.

Hard Rules

  • Do not bypass uriUtils.validateUrl, parseDappRedirect, validateWebviewSrc, or deep link handling when loading arbitrary URLs.
  • Do not mutate tabs without buildWebTabs/setWebTabData; persistence and active-tab maps depend on that path.
  • Do not clear shared Electron webview session cache from per-tab cleanup; webviews share partition="persist:onekey".
  • Do not pass secrets, raw clipboard text, or unbounded payloads through modal params or defaultLogger.
  • For analytics changes, also use /1k-analytics.

Related Skills

  • /1k-cross-platform - Platform suffixes.
  • /1k-state-management - Jotai atoms.
  • /1k-feature-guides - Routes/modals.
  • /1k-i18n - Translations.
  • /1k-analytics - Discovery logging.
  • /1k-performance - WebView/tab/list performance.
Repository
OneKeyHQ/app-monorepo
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.