淘宝规格名字显示

像手机淘宝一样选择规格时会显示它的名称而不是只显示图片

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         淘宝规格名字显示
// @namespace    http://tampermonkey.net/
// @version      0.4.1
// @description  像手机淘宝一样选择规格时会显示它的名称而不是只显示图片
// @author       You
// @include      *://*.taobao.com/*
// @include      *://*.tmall.com/*
// @grant        none
// ==/UserScript==

(function() {
addGlobalStyle(".tb-prop .tb-img li a span{max-width:1000px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-indent:0}.tb-prop .tb-img li a{text-decoration:none;width:auto!important;background-position:left center!important;padding:0 9px 0 45px!important}#detail .tb-key .tb-prop .tb-img li span{display:inline}");function addGlobalStyle(css){var head,style;head=document.getElementsByTagName("head")[0];if(!head){return}style=document.createElement("style");style.type="text/css";style.innerHTML=css;head.appendChild(style);};
setTimeout(function(){if(typeof(Hub)=="undefined")return;var a = document.getElementsByTagName('dd')[0].firstElementChild.children;var aa=Hub.config.config.sku.valItemInfo.propertyMemoMap;for(var i=0;i<a.length;i++){var b=a[i];var c=a[i].dataset.value;if(typeof(aa[c])!="undefined"&&b.firstElementChild.firstElementChild.innerText!=aa[c]){b.firstElementChild.firstElementChild.innerText=aa[c]}};},3000);
})();