您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds "promo" class to promo review "div" elements
// ==UserScript== // @name Promo Reviews @MySKU.ru // @description Adds "promo" class to promo review "div" elements // @namespace https://sourceforge.net/u/van-de-bugger/ // @include http://mysku.ru/* // @version 1 // @grant none // ==/UserScript== /** Calls func for each element of the list. list can be either array or NodeList object (which is array-like but does not have forEach method). The func is called with 3 arguments: element, index, and list. **/ function forEach( list, func ) { if ( list != null ) { for ( var i = 0; i < list.length; ++ i ) { func( list[ i ], i, list ); }; }; }; var topics = document.getElementsByClassName( "topic" ); forEach( topics, function ( topic ) { var promo = topic.querySelectorAll( "ul.category-list a.list-item-link[href$=\"promo-reviews\"]" ); if ( promo.length > 0 ) { topic.classList.add( "promo" ); }; } ); /* end of file */