- Notifications
You must be signed in to change notification settings - Fork0
Add a find bar to Electron App
License
NotificationsYou must be signed in to change notification settings
avwo/electron-find-bar
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
English |中文
This npm package is used to add a find bar to Electron App, and it is very easy to use.
npm i --save find-bar
const{ app}=require('electron');constsetFindBar=require('find-bar');// add find bar to all windowsapp.on('browser-window-created',(_,win)=>{// do something...setFindBar(win);});
Find bar is implemented throughBrowserWindow
, which is essentially a window object. You can usewin._isFindBar
to determine whether it is a find bar, and you can usewin._hasFindBar
to determine whether the current window is bound to a find bar,and the detailed usage ofsetFindBar
is as follows.
exportinterfaceFindBarOptions{left?:number;right?:number;// 80 by defaulttop?:number;// (mac: 20, win: 30) by defaultbottom?:number;darkMode?:boolean;// true by default}exportdefaultfunction(win:any,options?:FindBarOptions):void;
