SnosMe / electron-overlay-window

Creating overlays is easy like never before
MIT License
201 stars 38 forks source link

How do I detach a window #6

Closed Taimoor-Tariq closed 4 years ago

Taimoor-Tariq commented 4 years ago

I tried closing the window I attached to my program so I can attach a new window on it, but it still has that non existing window attached to it.

Also is there a way to toggle the visibility of the overlay window?

SnosMe commented 4 years ago
  1. If you want to close overlay window, you need to close the electron app all together.
  2. Use CSS
Taimoor-Tariq commented 4 years ago

I can't use CSS as I'm using ingameOverlay.loadURL('link to URL'); to load the window which is from a website I don't own.

Usually I would use ingameOverlay.hide() or ingameOverlay.show() to hide or show the windows but doing that does not work when I attach it to my game application.

I tried using ingameOverlay.setSize(0,0) and it worked but i need to know the size of the target app to resize it back to normal (show on screen)

SnosMe commented 4 years ago

I think you have to revisit docs, you are controlling browser and can do whatever you want.

https://www.electronjs.org/docs/api/web-contents#contentsexecutejavascriptcode-usergesture

Taimoor-Tariq commented 4 years ago

Thanks