Skip to content
On this page


We provide some common capabilities for easy use in development. Named $he3, you can access it through window.$he3.

The following is a list of APIs. Please refer to the demonstration code below for specific calling methods.

  • message triggers global message prompts
  • copyText copies a piece of text
  • subscribeThemeChange subscribes to theme changes
  • downloadByUrl downloads a file via URL
  • lang current language
  • theme current theme
  • shellOpenExternal opens a URL with a system default protocol. The main scenario is to open a URL address through a browser.
  • isDev whether the current environment is a development environment
  • isMacOS whether the current device is Mac
  • isWindows whether the current device is Windows
  • isLinux whether the current device is Linux
  • getSearchValue gets the content entered in the search input (only needs to be rendered in the search box)
  • getLastClipboard gets the current contents of the clipboard
  • onUseClipboardValue callback function triggered after using the clipboard, notifying the user

Global message prompts


Get current clipboard content

$he3.getLastClipboard().then((data) => {

Copy text

$he3.copyText('copy text');

Get current theme

Gets the current theme, returns dark or light


Subscribe theme changes

subscribeThemeChange accepts a callback function. When the theme changes, it will trigger the callback function, which will return the current theme, dark or light.

Developers don't need to pay attention to whether the current theme follows the system theme or the user-defined theme. Just subscribe to this event, and then make corresponding processing according to the theme change. We will keep the global themes consistent.

$he3.subscribeThemeChange((data) => {

Get current language

The following is a list of languages we currently support:

  • en English
  • zh Simplified Chinese
  • zh-tw Traditional Chinese
  • es Spanish
  • ja Japanese
  • ko Korean
  • de German
  • fr French
  • it Italian
  • ru Russian
  • pt Portuguese

Download file by URL