回答

1

它應該很簡單,只需使用Javascript setTimeoutsetInterval中的標準方法即可。

var seconds = 10 * 1000; 
var windowId = some window id; 
setTimeout(function() { 
    chrome.tabs.captureVisibleTab(
    some window id, 
    {}, 
    function() { ... do something with the screen shot ;}) 
    } 
, seconds); 

這將在10秒後截取屏幕截圖。以秒爲單位截取可見選項卡的屏幕截圖使用setInterval

var seconds = 10 * 1000; 
var windowId = some window id; 
setInterval(function() { 
    chrome.tabs.captureVisibleTab(
    some window id, 
    {}, 
    function() { ... do something with the screen shot ;}) 
    } 
, seconds); 
相關問題