2016-12-01 15 views

答えて

1

クロムには、アイドル状態を検出する専用API chrome.idleがあります。

chrome.idle.queryState(
    5 * 60, // seconds 
    function(state) { 
    if (state === "active") { 
     // Computer not locked, user active in the last 5 minutes 
    } else { 
     // Computer is locked, or the user was inactive for 5 minutes 
    } 
    } 
); 

また時に状態変化を通知する、chrome.idle.onStateChanged、イベントを提供します。ユーザーがブラウザウィンドウで非アクティブかどうかを知りたい場合は、投稿を見ることができます。Is there a way to detect if a browser window is not currently active?

+0

ありがとうございます。私はchrome.tabsでそれを探していました。 – SKG

関連する問題