窗口
Window
是DOM中 顶层window
对象的包装类 . 可扩展操作以及接收窗口事件 .
每个 Window
都是EventEmitter类实例 , 使用 Window.on(...)
可响应窗口事件 .
- 示例
- Window.get([window_object])
- Window.open(url, [options], [callback])
- win.window
- win.x
- win.y
- win.width
- win.height
- win.title
- win.menu
- win.isFullscreen
- win.isTransparent
- win.isKioskMode
- win.zoomLevel
- win.cookies.*
- win.moveTo(x, y)
- win.moveBy(x, y)
- win.resizeTo(width, height)
- win.resizeBy(width, height)
- win.focus()
- win.blur()
- win.show([is_show])
- win.hide()
- win.close([force])
- win.reload()
- win.reloadDev()
- win.reloadIgnoringCache()
- win.maximize()
- win.minimize()
- win.restore()
- win.enterFullscreen()
- win.leaveFullscreen()
- win.toggleFullscreen()
- win.enterKioskMode()
- win.leaveKioskMode()
- win.toggleKioskMode()
- win.showDevTools([iframe], [callback]) 该方法仅支持SDK构建方式中使用
- win.closeDevTools() 该方法仅支持SDK构建方式中使用
- win.getPrinters(callback)
- win.isDevToolsOpen() 该方法仅支持SDK构建方式中使用
- win.print(options)
- win.setMaximumSize(width, height)
- win.setMinimumSize(width, height)
- win.setResizable(resizable)
- win.setAlwaysOnTop(top)
- win.setVisibleOnAllWorkspaces(visible) (Mac and Linux)
- win.canSetVisibleOnAllWorkspaces() (Mac and Linux)
- win.setPosition(position)
- win.setShowInTaskbar(show)
- win.requestAttention(attension)
- win.capturePage(callback [, config ])
- win.setProgressBar(progress)
- win.setBadgeLabel(label)
- win.eval(frame, script)
- win.evalNWBin(frame, path)
- win.removeAllListeners([eventName])
- 事件: close
- 事件: closed
- 事件: loading
- 事件: loaded
- 事件: document-start(frame)
- 事件: document-end(frame)
- 事件: focus
- 事件: blur
- 事件: minimize
- 事件: restore
- 事件: maximize
- 事件: move(x, y)
- 事件: resize(width, height)
- 事件: enter-fullscreen
- 事件: zoom
- 事件: devtools-closed
- 事件: new-win-policy (frame, url, policy)
- 事件: navigation (frame, url, policy)