@akiflow/electron-panel-window

中文文档
10.3.0发布于 2026/11/02ISCCommonJS近 30 天下载 1799

Create Electron BrowserWindow's that act like Panels

原始使用文档
文档目录6 节
  1. 1. titleBarStyle should have the value 'customButtonsOnHove…
  2. 2. setVisibleOnAllWorkspaces(true) cannot be used on these …
  3. 3. Crash on quit
  4. Other
  5. Issues
  6. Old README of electron-panel-window

electron-panel-window

This fork of electron-panel-window. It works on macOS Ventura (tested). It works with Electron 45.2.1. (tested).

There are few caveats.

1. titleBarStyle should have the value 'customButtonsOnHover'

This will show two buttons on top left (to close and maximize the window). You can hide them by setting:

  • closable: false
  • maximizable: false

Beware that you may need some additional logic if you actually need to close the window, as win.close() won't work at this point. (you can check the test to see how we did this)

This looks no longer necessary in version 3.

2. setVisibleOnAllWorkspaces(true) cannot be used on these windows

Apparently it causes everything to crash.

3. Crash on quit

There are usually some electron crash when quitting an app with a panel window. Usually they can be fixed by:

  1. hiding the panel window
  2. make another window as key (use makeKeyWindow on another window)
  3. transform the panel in a normal window (use makeWindow)
  4. close the window
  5. quit the app

We have noticed less/no crashes if steps 2-5 are execture after a setTimout like:

win.hide()
setTimeout(()=>{
    electronPanelWindow.makeKeyWindow(otherWin)
    electronPanelWindow.makeWindow(win)
    win.close()
    app.quit()
})

destroy() is not considered safe on a window that is still panelized. close() is also not considered safe until you first call makeWindow(win).

Other

Removed win and linux support as it was empty in the first place.

You may want to include the package dynamically:

const electronPanelWindow = process.platform === 'darwin' ? require('electron-panel-window') : undefined

Issues

Feel free to open an issue, and report other "workarounds" to keep this working.

Methods

Install

npm install @akiflow/electron-panel-window

require

const electronPanelWindow = process.platform === 'darwin' ? require('@akiflow/electron-panel-window') : undefined
  1. makeKeyWindow(win) focus the window without activating the application
  2. makePanel(win) transform the given window in a panel
  3. makeWindow(win) transform the given panel in a window (required before close() or destroy() on macOS)

Credits


Old README of electron-panel-window

Something may be useful, something may be outdated

You can find it here: https://github.com/goabstract/electron-panel-window/

版本与发布记录

@akiflow/electron-panel-window 共发布 20 个版本,首次发布于 2021/03/09;过去 12 个月发布了 5 个版本。

版本发布日期距今
10.3.0latest2026/11/025 天前
10.2.02026/07/303 个月前
10.1.12026/07/143 个月前
10.1.02026/07/143 个月前
10.0.02026/03/257 个月前
9.0.12025/10/201 年前

关于 @akiflow/electron-panel-window 的常见问题

@akiflow/electron-panel-window 是什么?

Create Electron BrowserWindow's that act like Panels

如何安装 @akiflow/electron-panel-window?

在项目目录运行 npm install @akiflow/electron-panel-window,或使用 pnpm add / yarn add / bun add。

@akiflow/electron-panel-window 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/akiflow__electron-panel-window 是否存在。

@akiflow/electron-panel-window 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@akiflow/electron-panel-window 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22 <25。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@akiflow/electron-panel-window 可以商用吗?

@akiflow/electron-panel-window 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@akiflow/electron-panel-window 的下载量有多少?

根据 npm 官方下载统计,@akiflow/electron-panel-window 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,799 次,日均约 60 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@akiflow/electron-panel-window 还在维护吗?

最新版本 10.3.0 发布于 2026/11/02(5 天前);至今共发布 20 个版本,其中过去 12 个月发布了 5 个;首次发布于 2021/03/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。