Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7641357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:54:05+00:00 2026-05-31T08:54:05+00:00

I am catching the close event for tab, but how I can which tab

  • 0

I am catching the “close” event for tab, but how I can which tab was closed?

safari.application.addEventListener("close", function(e){
     // all e.target values are undefined, which is not helpful..    
},true)

Do you have any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:54:07+00:00Added an answer on May 31, 2026 at 8:54 am

    At the moment the event is captured, the properties of e.target (the closed tab) are not undefined. I’m guessing you’re using something like console.log(e.target) and then examining the logged object in the console. You’re seeing undefined properties then because the event has already finished propagating.

    Try this instead:

    safari.application.addEventListener("close", function (e) {
        if (e.target instanceof SafariBrowserTab) {
            console.log(e.target.title, e.target.url);
        }
    }, true);
    

    You will see that the tab’s properties are still defined at the moment of event capture, so you can compare them to previously stored values; or, if you have previously assigned the desired tab to a variable, you can even compare e.target itself to that variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By referring to C++ catching all exceptions try { int i = 0; int
I had someone mention to me that catching all exceptions is not necessarily good
I am using the exception catching procedure which is the module to track the
I am catching user logouts with hook with logout.events.post=... action and this works. But
I have an interceptor for catching Exceptions and sending emails of this exceptions. All
I am catching the form submission with jquery. This submit handler works in all
I'm using the following code to unzip files. I'm catching this exception unZip()=java.io.IOException, but
Here's our basic requirements: We have a base Rails application, which is being actively
I have built a php script which receives values in $_POST and $_FILES I'm
I've looked at a number of questions but still can't quite figure this out.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.