TikTok Live Expander

Automatically clicks show more on following and recommending

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name TikTok Live Expander
// @author fulingen
// @description Automatically clicks show more on following and recommending
// @version 0.3.2
// @license GNU GPLv3
// @supportURL https://t.me/fulingen
// @match https://www.tiktok.com/live
// @match https://www.tiktok.com/live*
// @match https://www.tiktok.com/*/live
// @match https://www.tiktok.com/*/live*
// @namespace https://greasyfork.org/users/980311
// ==/UserScript==

const xpr = XPathResult.FIRST_ORDERED_NODE_TYPE;
const text = 'See all';
let xpath;
let node;

setInterval(() => {
  xpath = '/html/body/div[1]/main/div[4]/div[1]/div/div[1]/div[1]/div/div[2]/div/div[2]/div[6]';
  node = document.evaluate(xpath, document, null, xpr, null).singleNodeValue;

  if (node) {
    if (node.innerText == text) {
      node.click();
    }
  }

  xpath = '/html/body/div[1]/main/div[4]/div[1]/div/div[1]/div[1]/div/div[3]/div/div[2]/div[6]';
  node = document.evaluate(xpath, document, null, xpr, null).singleNodeValue;

  if (node) {
    if (node.innerText == text) {
      node.click();
    }
  }

}, 100);