Implemented minimize funtionality using postMessage()