回答

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); 
相关问题