Docking electron desktop app above browsers and other applications.


Joined
Mar 11, 2022
Messages
2
Reaction score
0
I have asked this question on a number of different forums and have not been able to find a solution. Can ANYONE tell me if this can be done?

When launched my Browserwindow is currently placed at the top of my screen which is what I want. However I also want the browser window to SIT ABOVE other applications. google chrome and other browsers such as Microsoft edge should sit below the electron app. (similar to how the windows taskbar works.)

I've looked at discussions online and apparently this is doable on macOs, however no ones really said for definite if this can be done on windows 10 or not.

Heres my code:

JavaScript:
const createWindow = () => {
    // Create the browser window.
    const mainWindow = new BrowserWindow({
        width: 1920,
        height: 200,
        alwaysOnTop:true,
        titleBarStyle: 'none',
        frame: false,
        resizable: false,
        minimizable: false,
        type: 'toolbar',
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false}
        });
 
    mainWindow.setAlwaysOnTop(true, "screen-saver");
    mainWindow.setVisibleOnAllWorkspaces(true);
    mainWindow.setMenuBarVisibility(false);
    mainWindow.moveTop();
    mainWindow.setPosition(0,0)
    // and load the index.html of the app.
    mainWindow.loadFile(path.join(__dirname, 'index.html'));


Does anyone have a solution for this?

Thankyou
 
Ad

Advertisements

Joined
Mar 11, 2022
Messages
82
Reaction score
8
There is no way to do any browserdocking with javascript. Sorry. With window.open you have some sort of options. But that won't help you. Even fullscreen can't be executed just by code without user interaction.

Which actually is good. No website should be able to do on my screen what i usually do by myself. Security.

That was possible in the very old days of javascript. Nowadays it's only possible with really old browsers. No one uses them anymore.

So again. Just no. Even not possible on mac. So if that works on your mac, than that's kind of weird.

But of course it's possible if the users allowes ist (e.g. by click a button)

But i doubt, that it will keep your browser lay over anything else if your users click on anything else. (Like e.g. menu bar)
 
Joined
Mar 11, 2022
Messages
2
Reaction score
0
There is no way to do any browserdocking with javascript. Sorry. With window.open you have some sort of options. But that won't help you. Even fullscreen can't be executed just by code without user interaction.

Which actually is good. No website should be able to do on my screen what i usually do by myself. Security.

That was possible in the very old days of javascript. Nowadays it's only possible with really old browsers. No one uses them anymore.

So again. Just no. Even not possible on mac. So if that works on your mac, than that's kind of weird.

But of course it's possible if the users allowes ist (e.g. by click a button)

But i doubt, that it will keep your browser lay over anything else if your users click on anything else. (Like e.g. menu bar)


ahh man that sucks! Thank you for the prompt response and all the information you have provided, i really appreciate it!... Do you know if there would be any way of me being able to dock the desktop app above browsers and other applications if i were to use a different language e.g c++? i.e write a program which i could then integrate into the electron app.

Ideally i would want it to be cross platform so it works on both windows and mac devices.
 
Joined
Mar 11, 2022
Messages
82
Reaction score
8
Actually yes. But unfortunately i completely lost the link and name as it is Actionscript 2 (which is extincted already) plus this AS2 compiling software for PC and MAC. Something like XING. Not the website. The name were similar. Don't know.

Maybe google for it. There should be enough AS2 programms be out there for free as it's extincted. So also the X compiler.

Actionscript 2 has a alot of similarities to JS. So should'nt be a problem to get into it. Plus, AS allows you to show and use your Websites in a "kind of browser".

With Xing or whatever it is called you may compile a executable Software (with icon and all the stuff) for PC and MAC. And within AS 2 there is options to let the softwarelayer be above anything else.

Good luck.
 
Ad

Advertisements

Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top