javascript - win.toggleTabBar() 在 Electron 中不起作用

标签 javascript node.js macos electron

documentation提供显示标签栏的选项( win.toggleTabBar() )。但就我的一生而言,我只是无法让它发挥作用。

文档说“切换标签栏的可见性 如果启用了原生标签 ”。什么是原生标签?我如何启用它们。

我希望能够在 Electron 中显示标签栏。

最佳答案

根据 docs :

tabbingIdentifier String (optional) - Tab group name, allows opening the window as a native tab on macOS 10.12+. Windows with the same tabbing identifier will be grouped together. This also adds a native new tab button to your window's tab bar and allows your app and window to receive the new-window-for-tab event.



这是 added in 2017允许在 OSX 中使用“ native 选项卡”。为了让它工作,你必须通过 tabbingIdentifier创建新的 BrowserWindow 时。

const { BrowserWindow } = require('electron')

const win = new BrowserWindow({ 
   tabbingIdentifier: 'myTabs'
});

关于javascript - win.toggleTabBar() 在 Electron 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59249853/

相关文章:

macos - macOS Mojave 10.14.2 上的 gdb

objective-c - 创建垂直选项卡式 OS X Cocoa View

macos - 在 Mac OS X 上使用 sed 进行字符串替换有什么问题?

javascript - 如何使用 Immutable.js 提供 Flux 存储之间的依赖关系?

javascript - 将 json 加载到 chart.js 中

javascript - 如何从javascript下载文件

node.js - 如何正确反向代理nodejs子路由?

javascript - 查找相对文件路径来解析 Excel 文件

javascript - 通过 JS 更改 TYPE 属性。这是安全问题吗?

node.js - Watson Conversation 中的多个输出文本值设置