您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
在页面显示商品UPC码
当前为
// ==UserScript== // @name 沃尔玛查询upc // @namespace http://tampermonkey.net/ // @version 0.2 // @description 在页面显示商品UPC码 // @author Take // @match *://www.walmart.com/ip/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function() { var html = document.documentElement.outerHTML; var a = html.indexOf('"upc":"'); var b = html.indexOf('","fetched"'); var upc = html.substring(a+7,b); console.log("upc为:",upc); if(upc!="" && upc.length<=12){ var div = document.createElement("div"); div.innerHTML = "<div class='upc' onclick='copyText()'>UPC:"+upc+"</div><style>.upc{position: fixed;right: 0;top: 18%;background-color: #2271dc;border-radius: 5px;color: white;padding: 5px 15px;z-index: 99999;}</style>"; document.body.appendChild(div); } })();