Greasy Fork

Greasy Fork is available in English.

虎牙免登陆清晰度

虎牙免登陆可控清晰度(虎牙更新播放器规则暂时失效,等后续有时间再做处理)

当前为 2022-05-12 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         虎牙免登陆清晰度
// @namespace    https://github.com/demon-zhonglin/tmJavaScript
// @version      0.3
// @description  虎牙免登陆可控清晰度(虎牙更新播放器规则暂时失效,等后续有时间再做处理)
// @author       demon-zhonglin
// @include      https://*.huya.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
  'use strict';

  function getCookieValueByName(name) { // 从 cookie 中获取 key 值
    var match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
    return match ? match[2] : "";
  }

  const isLogin = getCookieValueByName('udb_passport') // 当前登录用户 虎牙号
  if (!isLogin) {
    localStorage.setItem('loginTipsCount', -1e+35);

    if (typeof $ === 'function') { // huya 自带有引用 jq
      $(document).ready(function(){
        if (!isLogin) {
          $('#player-login-tip-wrap').remove();
          $('#UDBSdkLgn').hide()
          VPlayer.prototype.checkLogin(true);
        }
      })
    }
  }

})();