华为Cloud-V0.902

按钮

// ==UserScript==
// @name         华为Cloud-V0.902
// @icon         http://yy.boloni.cn/cm/images/favicon.ico
// @namespace    http://tampermonkey.net/
// @version      0.902
// @description  按钮
// @author       HEBI VISION
// @match        http://*/*
// @match        https://*/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==


(function() {
    'use strict';

    // 定义要查找并删除的元素的选择器
    const selectors = ['#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > img,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div:nth-child(1) > div > ul,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div:nth-child(1) > div > div.map-scale.show,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_BellNavi,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_Control,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.device_operation > div.device_Modify > div,#app > div.find_phone.isWapFindPhone > div.master_detail > div > div.header > div.header_content > div.header_name_item,#app > div.find_phone.isWapFindPhone > div.wap-panel > div:nth-child(1) > div > div:nth-child(3) > div > ul > div > div.findPhone-device-content > div > div.findPhone-first-line > div.findPhone-device-name,#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > img,#app > div.find_phone.isWapFindPhone > div.wap-panel > div.findPhoneWap-bottomtab > div'];

     // 每0.5秒执行一次查找和删除操作
    setInterval(function() {
        selectors.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            elements.forEach(element => {
                element.remove();
            });
        });
    }, 500);

window.setInterval(function () {
document.querySelector('#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > span > img').src = 'https://contentcenter-drcn.dbankcdn.cn/pub_1/Club_ClubFileContent_100_9/6e/v3/vF09jyrFSDWEJ1sVRNXrnA/ns5P_pypR5GWmFonMrAyEg/thumbnail.gif';
},500);
window.setInterval(function () {
document.querySelector('#app > div.find_phone.isWapFindPhone > div.wap-panel > div:nth-child(1) > div > div:nth-child(3) > div > ul > div > div.findPhone-device-img > span.deviceImg > img').src = 'https://contentcenter-drcn.dbankcdn.cn/pub_1/Club_ClubFileContent_100_9/6e/v3/vF09jyrFSDWEJ1sVRNXrnA/ns5P_pypR5GWmFonMrAyEg/thumbnail.gif';
},500);
//https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/pdp/wearables/kids-watch-5x/images/s2/huawei-kids-watch-5x-all-round-guard-function-girl.gif

window.setInterval(function () {
    // 在这里指定要删除背景颜色的元素的选择器
    var selector = 'div.findPhone-device-img';
    // 获取所有匹配选择器的元素
    var elements = document.querySelectorAll(selector);
    // 遍历每个匹配的元素并删除背景颜色
    elements.forEach(function(element) {
        element.style.backgroundColor = 'transparent';
    });
},500);



//持续判断元素.svg-icon[data-v-710c972e]的height是不是2em

    // 定义一个函数,用于检查并设置SVG图标的高度
    function checkAndSetIconHeight() {
        // 查找所有具有指定类的SVG图标元素
        const svgIcons = document.querySelectorAll('.svg-icon[data-v-48571be8]');

        svgIcons.forEach(icon => {
            // 获取当前高度
            const currentHeight = window.getComputedStyle(icon).height;

            // 如果当前高度不等于2em,则设置高度为2em
            if (currentHeight !== '2em') {
                icon.style.height = '2em';
            }
        });
    }

    // 初始时执行一次
    checkAndSetIconHeight();

    // 监听DOM变化,以便动态添加的元素也能被处理
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            if (mutation.type === 'childList') {
                checkAndSetIconHeight();
            }
        });
    });

    // 选择需要观察的节点,这里选择整个文档体,可以根据需要调整
    const targetNode = document.body;

    // 配置观察选项
    const config = { attributes: false, childList: true, subtree: true };

    // 开始观察目标节点
    observer.observe(targetNode, config);




//持续判断元素transform: translate是不是(-40%, -100%)

    // 定义目标元素的选择器
    const elementSelector = '#app > div.find_phone.isWapFindPhone > div.map-content.eject > div.map-position > div > div > div.gd-map-kit > div.amap-container > div.amap-maps > div.amap-layers > div > div > div > div > div > div > span';

    // 定义一个函数,用于设置元素的transform属性
    function setElementTransform() {
        // 获取目标元素
        const targetElement = document.querySelector(elementSelector);

        if (targetElement) {
            // 强制设置元素的style.transform属性值
            targetElement.style.transform = 'translate(-45%, -150%)';
        } else {
            console.warn('目标元素未找到');
        }
    }

    // 初始执行一次
    setElementTransform();

    // 使用setInterval每0.5秒执行一次设置transform的函数
    setInterval(setElementTransform, 500);



})();