Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name AMZ colors count
- // @include /^https?://www\.amazon(\.com?)?\.[a-z]{2,3}/.*$/
- // @namespace /^https?://www\.amazon(\.com?)?\.[a-z]{2,3}/.*$/
- // ==/UserScript==
- (function() {
- let selectNum = document.querySelectorAll("#native_dropdown_selected_color_name option").length - 45;
- if( document.querySelectorAll("#variation_color_name li").length == 0 && document.querySelectorAll("#native_dropdown_selected_color_name option").length != 0) {
- document.querySelector("#productTitle").innerHTML += "<div style='margin: 20px 0; font-size: 27px'><strong>Kolory:</strong> Za dużo o <strong><span style='color: #ff2b55'>" + selectNum + "</span></strong> kolory!!!11one</div>";
- } else if ( document.querySelectorAll("#native_dropdown_selected_color_name option").length == 0 && document.querySelectorAll("#variation_color_name li").length == 0) {
- document.querySelector("#productTitle").innerHTML += "<div style='margin: 20px 0; font-size: 27px'><strong>Kolory:<span style='color: #ff2b55'>1</span></strong></div>";
- } else {
- document.querySelector("#productTitle").innerHTML += "<div style='margin: 20px 0; font-size: 27px'><strong>Kolory:<span style='color: #ff2b55'> " + document.querySelectorAll("#variation_color_name li").length + "</span></strong></div>";
- }
- }())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement