cyfung1031 / userscript-supports

This is for the userscripts created on GreasyFork.org.
https://cyfung1031.github.io/userscript-supports/
MIT License
48 stars 3 forks source link

[YouTube Super Fast Chat] Incompatible with BetterStreamChat's latest version - setting addition #13

Closed cyfung1031 closed 1 year ago

cyfung1031 commented 1 year ago

Bug to be fixed.

// ==UserScript==
// @name        Testing Script 186
// @namespace   Violentmonkey Scripts
// @match       https://www.youtube.com/live_chat*
// @grant       none
// @version     1.0
// @author      -
// @description 8/19/2023, 11:41:39 PM
// @run-at              document-start
// @grant               none
// @unwrap
// @allFrames           true
// @inject-into         page
// ==/UserScript==

(() => {
  'use strict';

  const updateFlags = () => {
    const EXPERIMENT_FLAGS = (window.ytcfg && window.ytcfg.data_) ? window.ytcfg.data_.EXPERIMENT_FLAGS : null;
    if (!EXPERIMENT_FLAGS) return;
    Object.assign(EXPERIMENT_FLAGS, {
      kevlar_tuner_should_test_maintain_stable_list: true,
      kevlar_should_maintain_stable_list: true
    });
  };

  const mo = new MutationObserver(updateFlags);
  mo.observe(document, { subtree: true, childList: true });

  updateFlags();

})();

Remarks

Tested that it is not a bug in YouTube Super Fast Chat. Opened an issue in https://github.com/derpierre65/BetterStreamChat/issues/26


Pending new version publishing in Chrome Store