Greasy Fork is available in English.
一个显示沃尔玛商品UPC的工具!
当前为
// ==UserScript==
// @name 沃尔玛查询upc
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 一个显示沃尔玛商品UPC的工具!
// @author You
// @match *://www.walmart.com/ip/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
var html = document.documentElement.outerHTML;
console.log("我的输出",html);
var a = html.indexOf('"upc":"');
var b = html.indexOf('","fetched"');
var upc = html.substring(a+7,b);
console.log("upc为:",upc);
if(upc!=""){
var div = document.createElement("div");
div.innerHTML = "<div class='upc' onclick='copyText()'>UPC:"+upc+"</div><style>.upc{position: fixed;right: 0;top: 15%;background-color: #2271dc;border-radius: 5px;color: white;padding: 5px 15px;z-index: 99999;}</style>";
document.body.appendChild(div);
}
})();