var tagIframe = document.getElementsByTagName('iframe')[0]; var windowX = 690, windowY = 690; tagIframe.width = 640; tagIframe.height = 480; document.window.resizeTo(windowX, windowY); document.window.moveTo((screen.width - windowX) / 2, (screen.height - windowY) / 2); var anchor = document.getElementsByTagName('a')[0]; anchor.target = "_blank";