{"size": 1098, "ext": "js", "max_stars_repo_path": "assets/helper/open-window/index.js", "max_stars_repo_name": "bdwallet/wallet-app", "max_stars_repo_stars_event_min_datetime": "2020-12-06T16:53:30.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-06T16:53:30.000Z", "max_issues_repo_path": "assets/helper/open-window/index.js", "max_issues_repo_name": "bdwallet/wallet-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/helper/open-window/index.js", "max_forks_repo_name": "bdwallet/wallet-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 68.625, "max_line_length": 231, "alphanum_fraction": 0.7213114754}
export default function openWindow(url, option ={}) {
	const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left
	const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top
	const _width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width
	const _height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height
	
	const width  = option.width || 600;
	const height = option.height || 300;
	const left   = 'number' == typeof option.left ? option.left : ((_width / 2) - (width / 2)) + dualScreenLeft
	const top    = 'number' == typeof option.top ? option.top : ((_height / 2) - (height / 2)) + dualScreenTop

	
	const newWindow = window.open(url, '_blank','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left)

	if (window.focus) newWindow.focus()
}