Greasy Fork

Greasy Fork is available in English.

淘宝规格名字显示

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);
})();