X-BeenThere: chromium-extensions@googlegroups.com Received: by 10.150.168.35 with SMTP id q35ls293439ybe.0.p; Wed, 20 Jan 2010 23:17:47 -0800 (PST) Received: by 10.150.118.16 with SMTP id q16mr1298740ybc.25.1264058267799; Wed, 20 Jan 2010 23:17:47 -0800 (PST) Received: by 10.91.55.8 with SMTP id h8mr1525827agk.1.1264057555224; Wed, 20 Jan 2010 23:05:55 -0800 (PST) Received: by 10.91.55.8 with SMTP id h8mr1525825agk.1.1264057555188; Wed, 20 Jan 2010 23:05:55 -0800 (PST) Return-Path: Received: from mail-yx0-f166.google.com (mail-yx0-f166.google.com [209.85.210.166]) by gmr-mx.google.com with ESMTP id 18si67520ywh.1.2010.01.20.23.05.55; Wed, 20 Jan 2010 23:05:55 -0800 (PST) Received-SPF: pass (google.com: domain of wmbenede...@gmail.com designates 209.85.210.166 as permitted sender) client-ip=209.85.210.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wmbenede...@gmail.com designates 209.85.210.166 as permitted sender) smtp.mail=wmbenede...@gmail.com Received: by yxe38 with SMTP id 38so13909391yxe.6 for ; Wed, 20 Jan 2010 23:05:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.161.1 with SMTP id j1mr32784ybe.21.1264057555147; Wed, 20 Jan 2010 23:05:55 -0800 (PST) Date: Wed, 20 Jan 2010 23:05:55 -0800 (PST) X-IP: 99.9.154.93 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.64 Safari/532.5,gzip(gfe),gzip(gfe) Message-ID: Subject: Detect when Chrome is minimized or out-of-focus? From: Warren Benedetto To: Chromium-extensions Content-Type: text/plain; charset=ISO-8859-1 I just released an extension (StayFocusd) which allows you to create a blacklist of time-wasting websites, and then prevents you from accessing them once time runs out. The elapsed time counts down whenever you are on one of the blacklisted sites. The problem is, if you're on a blacklisted site, and then you minimize Chrome or maximize another site in front of it, the countdown on the blacklisted site continues. I'd like to be able to stop the countdown when Chrome is not the active window. I see the chrome.windows.onFocusChanged() event, but that doesn't seem to do what I need. It detects when focus changes between different Chrome instances, but not when focus changes from Chrome to another app. Are there any existing APIs that I can use to accomplish what I need? If not, are there any plans for something like this?