Closing a browser window/tab by JS

Michael Monschau michael at brainydata.co.uk
Wed May 12 07:10:47 UTC 2021


Hi Mike

The following JS may work (I haven’t tested it)

var popupWindowRef; // global var
function doOpenPopup() {
	popupWindowRef = window.open();
}

function doClosePopup() {
	popupWindowRef.close();
}

Michael Monschau
Brainy Data Ltd
Omnis Components Portal
Web: https://www.brainydata.com

sent from my iPad

> On 11 May 2021, at 08:28, Paul Mulroney <pmulroney at logicaldevelopments.com.au> wrote:
> 
> Hi Mike,
> 
> Stack overflow suggests:
> 
> https://stackoverflow.com/questions/29220735/script-to-close-other-tabs-or-browser/29220934
> 
> If you want to open a new tab and close the current one, use something like this in html:
> 
> <a href='https:...'
>    onclick='window.open(this.href); window.open("", "_self", "").close(); return false;'>
>  Open new tab, close this one
> </a>
> 
> 
> 
> 
>> On 11 May 2021, at 2:55 pm, Mike Matthews - Omnis <omnis at lineal.co.uk> wrote:
>> 
>> Hello All,
>> 
>> In our website, we open a new page and then set the URL to run Omnis and a Remote form.  All good.
>> 
>> This is not a new tab, but a pop out type, I’m no expert here with this jargon, so it might be a pop out Frame.
>> 
>> Can Omnis close either this window or a tab if that was it was running in?
>> 
>> Recenty is used the command ‘_self’ to send the current tab to a new URL:
>> Do $cinst.$showurl(lvHomePage,'_self’)
>> 
>> Can you even close a window/tab/pop out frame, some Googling suggests you can’t. So right now, I end up putting a message asking the user to close this window/tab/pop out frame.
>> 
>> Thanks
>> 
>> Mike Matthews
>> 
>> Lineal Software Solutions
>> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
>> 
>> omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
>> 
>> www.lineal.co.uk<http://www.lineal.co.uk/>
>> 
>> www.sqlworks.co.uk<http://www.sqlworks.co/>
>> 
>> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> 
> I couldn't quite remember how to throw a boomerang, but eventually it came back to me.
> -- 
> Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
> pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
> www.logicaldevelopments.com.au                   ACN 161 009 374 
> Ph: +61 8 9458 3889                                       86 Coolgardie Street
>                                                                         BENTLEY  WA  6102
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


More information about the omnisdev-en mailing list