cancelBtn

取消离线包图片选中态!

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         cancelBtn
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  取消离线包图片选中态!
// @author       You
// @match        https://yoda.corp.kuaishou.com/*
// @icon         https://www.google.com/s2/favicons?domain=kuaishou.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let cancelBtn = document.createElement('div');
    cancelBtn.innerHTML = "取消图片";
    cancelBtn.className = "yh_cancelBtn";
    cancelBtn.onclick = function(){
        // 模拟点击页面展开符
        const pages = document.querySelectorAll('.tree-checkbox-selection > ul > li > i');
        pages.forEach((item) => {
            item.click();
        });
        // 模拟点击success展开符
        const success = document.querySelectorAll('.tree-checkbox-selection > ul > li > ul > li > i');
        success.forEach((item) => {
            item.click();
        });
        // 模拟点击img展开符
        const imgsTree = document.querySelectorAll('.tree-checkbox-selection > ul > li > ul > li > ul > li:nth-child(4) > .tree-selected');
        imgsTree.forEach((item) => {
            item.children[0].click();
        });
    }
    document.body.appendChild(cancelBtn);
    let style = document.createElement('style');
    style.type = "text/css";
    let styleCon = document.createTextNode(".yh_cancelBtn{position: fixed; right: 0; top: calc(50% - 22px); width: 85px; height: 44px; font-size: 13px; background-color: #ff976a; border-radius: 2px; line-height: 44px; text-align: center; color: #fff;cursor: pointer;}")
    style.appendChild(styleCon);
    let head = document.getElementsByTagName('head')[0];
    head.appendChild(style);
})();