Javascript 如何在控制台中暂停Instagram故事切换,以便手动下载图像或视频

Javascript 如何在控制台中暂停Instagram故事切换,以便手动下载图像或视频,javascript,console,instagram,webbrowser-control,Javascript,Console,Instagram,Webbrowser Control,我想下载图像或视频,但我没有足够的时间在inspector中找到它。有人知道如何停止所有计时器或特定功能,以便我将其粘贴到控制台并停止Instagram故事切换吗?方法是暂停页面上的所有计时器 // Set a fake timeout to get the highest timeout id var highestTimeoutId = setTimeout(";"); for (var i = 0 ; i < highestTimeoutId ; i++) { clearTi

我想下载图像或视频,但我没有足够的时间在inspector中找到它。有人知道如何停止所有计时器或特定功能,以便我将其粘贴到控制台并停止Instagram故事切换吗?

方法是暂停页面上的所有计时器

// Set a fake timeout to get the highest timeout id
var highestTimeoutId = setTimeout(";");
for (var i = 0 ; i < highestTimeoutId ; i++) {
    clearTimeout(i); 
}
//设置假超时以获取最高的超时id
var highestTimeoutId=setTimeout(“;”);
对于(var i=0;i

但如果您切换选项卡,计时器将重新启动。

第一个答案会暂停故事中的图像,但不会暂停视频。我会将上面的代码(我认为这很聪明)与以下代码结合起来:

if (document.getElementsByTagName("video").length){
    document.querySelector("video").pause();
}
// Set a fake timeout to get the highest timeout id
var highestTimeoutId = setTimeout(";");
for (var i = 0; i < highestTimeoutId; i++) {
    clearTimeout(i);
}
if(document.getElementsByTagName(“video”).length){
document.querySelector(“视频”).pause();
}
//设置假超时以获取最高的超时id
var highestTimeoutId=setTimeout(“;”);
对于(var i=0;i