MCPcopy Create free account
hub / github.com/deta/surf / hideAllViews

Method hideAllViews

app/src/main/viewManager.ts:801–826  ·  view source on GitHub ↗
(opts?: { hidePermanentlyActive?: boolean })

Source from the content-addressed store, hash-verified

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 {

Callers 2

createViewMethod · 0.95
attachIPCEventsMethod · 0.95

Calls 5

removeChildViewMethod · 0.95
logMethod · 0.80
forEachMethod · 0.80
warnMethod · 0.80
focusMethod · 0.45

Tested by

no test coverage detected