Auto unmute Stories

Automaticly unmute stories / turn story audio on

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Auto unmute Stories
// @namespace   Violentmonkey Scripts
// @match       https://www.instagram.com/*
// @grant       none
// @version     1.2.1
// @author      jside
// @description Automaticly unmute stories / turn story audio on
// ==/UserScript==



var mainLoop = setInterval(()=>{
  try {
    videoElement = document.getElementsByClassName('_aa63  _ac3u')[0]
    audioButton = document.getElementsByClassName("_abl-")[1];
    
    if (videoElement.muted == true && audioButton.jside_done != true && videoElement.jside_tried != true) {
        audioButton.click();
        videoElement.jside_tried = true; // only run once per muted story
    }
    else if (videoElement.muted == false){
      audioButton.jside_done = true; // to allow muting again
    }
  }
  catch(err) {
  // lets not spam the console
  }
},1000);