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.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 {
- 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>";
- }
- }())
- // ==UserScript==
- // @name Item ID
- // @namespace http://www.ebay.de/
- // @include https://www.ebay.de/itm/*
- // ==/UserScript==
- (function() {
- let img = document.querySelectorAll(".tdThumb img");
- let title = document.querySelector("#itemTitle");
- let src = img[1].getAttribute("src");
- src = src.match(/(\/\d{4}\/)/g).toString().replace(/\//g,'');
- title.innerHTML += '<span style="color: red; font-size: 110%"><strong> ' + src + '</strong></span>';
- }())
- // ==UserScript==
- // @name Count Attr
- // @namespace https://www.ebay.de
- // @include https://www.ebay.de/itm/*
- // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
- // ==/UserScript==
- $( document ).ready(function() {
- let varNum = 0;
- let title = document.querySelector('#itemTitle');
- title.innerHTML += '<button name="submit" type="submit" id="submit">Ilość wariantów</button>';
- $('#submit').click(function() {
- //PĘTLA PO WSZYSTKICH MODELACH Z LISTY
- if($('body').hasClass('countedVariants') == false){
- for(let i = 0; i <= unsafeWindow.$('#msku-sel-1 option').length - 2; i++) {
- //WYBRANIE MODELU
- unsafeWindow.$('#msku-sel-1 option[value='+i+']').attr('selected','selected');
- unsafeWindow.$('#msku-sel-1 option[value='+i+']').change();
- //DODANIE DO ZMIENNEJ ILOŚCI ROZMIARÓW Z MODELU
- varNum += unsafeWindow.$('#msku-sel-2 option').length - 1;
- }
- //WYCZYSZCZENIE WYBORU
- unsafeWindow.$('#msku-sel-1 option[value=-1]').attr('selected','selected');
- unsafeWindow.$('#msku-sel-1 option[value=-1]').change();
- //WYPISANIE WYLICZONEJ WARTOŚCI
- document.querySelector('#submit').innerHTML += ' ' + varNum;
- $('body').addClass('countedVariants');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement