您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
xxx
// ==UserScript== // @name 获取店匠product id // @namespace http://tampermonkey.net/ // @version 0.1 // @description xxx // @author You // @match https://www.xxx.com/collections* // @match https://www.xxx.com/search* // @icon https://www.google.com/s2/favicons?domain=tasiliya.com // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... function getId(){ let ps = document.querySelectorAll(".product-snippet") function insertP(chNode){ var p = document.createElement("div") p.classList.add("hahaha") if (!chNode.contains(chNode.querySelector(".hahaha"))){ chNode.insertBefore(p, chNode.firstElementChild) p.innerText = chNode.dataset.trackId } } ps.forEach((i)=>{ insertP(i)}) } setInterval(()=>{ getId() },1000) })();