Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I'm currently creating a desktop app using electron, and what I would like to do is ensure that the app is automatically docked above all other applications/browsers when launched. Does anyone know if this is possible?

At the moment web browsers and apps sit behind the desktop app which makes it very inconvenient when users would like to close down/minimize other apps.

Below is the code I have at the moment.

function reasonsHorizontal() 
{
  sidebar = new BrowserWindow({height: 100, width:1300, titleBarStyle: 'none', frame:false, resizable: false, backgroundColor: '#283243',  webPreferences: { nodeIntegration: true, 
    contextIsolation: false}})
    sidebar.loadFile('sidebar.html')
    sidebar.setPosition(0,100, true)
    sidebar.setMenuBarVisibility(false)
    sidebar.setAlwaysOnTop(true, 'floating') 
    
}


What I have tried:

I have attempted to use the built in functions such as "moveTop() and setTopBrowserView()" but haven't been able to sort it. What I've also noticed is that there aren't many resources online for electron, which makes it even harder.

Does anyone have a solution for this?
Posted
Updated 24-Jan-22 23:43pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900