web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

(0) ShareShare
ReportReport
Posted on by

How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    I think you need to get all open tabs in an array and then try to close it.

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    Actually, if multiple CRM tabs are opened in a machine and we close any one of them , then all should close automatically .Is this possible in CRM.

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    Actually, if multiple CRM tabs are opened in a machine and we close any one of them , then all should close automatically .Is this possible in CRM.

  • Suggested answer
    Wayne Walton Profile Picture
    13,728 on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    This doesn't really seem like a CRM question.

    Also, JavaScript can't arbitrarily close browser tabs.  This is a security feature you don't want to override.  Furthermore, you don't control the close button of the browsers themselves, so closing other tabs from the event of closing a browser tab is well beyond your control, especially when different browsers have different tab implementations. OnUnload does something like that, but it can't tell the difference between a tab closure, a page refresh, or other session changes.  You would certainly get unexpected behavior if you tried to hijack it to close tabs.

    It can, however, close the current tab and all tabs you have a handle for (essentially all parent tabs of your tab).  But good luck getting all browsers to behave the same way when you use a window.close() event.  And it won't work from someone directly closing the tab itself.

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    Refer this: stackoverflow.com/.../get-urls-of-all-open-tabs-in-chrome-and-send-it-to-a-web-service

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    Instead of closing all tabs close the whole window.

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    I need to close all the tabs on browser, when one of the tabs is closed

  • Community Member Profile Picture
    on at
    RE: How can we close all the tabs opened in a browser when any one tab is closed.This needs to be done using javascript

    There is an event called tabstatechange which can be used here. Refer: community.dynamics.com/.../tab-state-change-event-crm-javascript

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans