(opts?: { hidePermanentlyActive?: boolean })
| 799 | } |
| 800 | |
| 801 | hideAllViews(opts?: { hidePermanentlyActive?: boolean }) { |
| 802 | const options = { |
| 803 | hidePermanentlyActive: opts?.hidePermanentlyActive ?? false |
| 804 | } |
| 805 | |
| 806 | log.log('[main] webcontentsview-hideAllViews: hiding all views with options', options) |
| 807 | this.views.forEach((view) => { |
| 808 | try { |
| 809 | if (view.opts.permanentlyActive && !options.hidePermanentlyActive) { |
| 810 | log.log( |
| 811 | '[main] webcontentsview-hideAllViews: skipping permanently active view with id', |
| 812 | view.id |
| 813 | ) |
| 814 | return |
| 815 | } |
| 816 | |
| 817 | log.log('[main] webcontentsview-hideAllViews: hiding view with id', view.id) |
| 818 | this.removeChildView(view) |
| 819 | } catch (e) { |
| 820 | log.warn('[main] Could not hide WebContentsView', e) |
| 821 | } |
| 822 | }) |
| 823 | |
| 824 | // focus the main window after hiding all views |
| 825 | this.window.webContents.focus() |
| 826 | } |
| 827 | |
| 828 | destroyView(view: WCView) { |
| 829 | try { |
no test coverage detected