Changed interface to decide if new window or tab is required.