Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 4 of 4

This is a discussion on How to know when popup.html loses focus ? within the Chrome Plugins section, part of the Google Chrome category: Hi everyone ! This is my first post here So I'm currently developing an extension for Chrome (oh really ? ...


  1. #1
    CoLoN3L is offline Junior Member
    Join Date
    Aug 2010
    Posts
    3

    Default How to know when popup.html loses focus ?

    Hi everyone ! This is my first post here

    So I'm currently developing an extension for Chrome (oh really ? ) and I have a little problem:

    I would like to be able to know when my popup.html loses focus.
    onFocus() works perfectly and fire when I click on my extension, but I don't know what to use when I click elsewhere and that my popup is closed. I tried onBlur(), but it's not working (it acts like onFocus actually...).

    Any suggestions ?
    Last edited by CoLoN3L; 09-04-2010 at 06:25 PM.

  2. #2
    CoLoN3L is offline Junior Member
    Join Date
    Aug 2010
    Posts
    3

    Default

    So I guess it's not possible ? :/

  3. #3
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    Try onunload......
    http://www.w3schools.com/jsref/event_onunload.asp
    <body onunload="chrome.extension.getBackgroundPage().console.log('bye bye');" >
    ....that'll do it for ya

  4. #4
    CoLoN3L is offline Junior Member
    Join Date
    Aug 2010
    Posts
    3

    Default

    Thanks a lot ! It works I tried onunload before and it wasn't working, but I didn't thought about calling the background page.

Similar Threads

  1. Javascript Set Focus Code Not Working
    By Zimbello in forum Chrome Troubleshooting
    Replies: 1
    Last Post: 08-13-2010, 07:08 AM
  2. experimental.popup
    By blindmurray in forum Plugins Development
    Replies: 0
    Last Post: 05-20-2010, 11:05 PM
  3. Focus address bar or content
    By a2720286 in forum Plugins Development
    Replies: 3
    Last Post: 04-09-2010, 12:44 PM
  4. Shift focus from webpage to Chrome
    By BordrGuy108 in forum Chrome Tips & Tricks
    Replies: 1
    Last Post: 11-29-2009, 07:10 PM
  5. Popup size
    By mg2 in forum Plugins Development
    Replies: 2
    Last Post: 11-24-2009, 03:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •