Greasy Fork is available in English.
10/10/2022, 10:19:36 AM
当前为
// ==UserScript==
// @name AMZ - SKU Delete
// @namespace Violentmonkey Scripts
// @match https://sellercentral.amazon.*/inventory*
// @grant none
// @version 1.3.2
// @author -
// @license Eveny One
// @description 10/10/2022, 10:19:36 AM
// ==/UserScript==
window.onload = function(){
url = window.location.href
if(/confirmAction/.test(url)){
try{
var hh = $("#interStitialPageMessage").html();
}catch(err) {
var hh = document.getElementById("interStitialPageMessage").textContent;
}
Num = hh.match(/\d+/);
if(Number(Num) == 0){
alert("当前产品数为0,停止操作")
}else{
setTimeout( function(){
try{
$("#interstitialPageContinue").click();
}catch(err){
document.getElementById("interstitialPageContinue").click();
}
}, 3 * 1000 )
setTimeout( function(){
try{
$("#interstitialPageContinue").click();
}catch(err){
document.getElementById("interstitialPageContinue").click();
}
}, 6 * 1000 )
setTimeout( function(){
window.location.href = window.location.href.split('/').slice(0,3).join('/') + "/inventory"
}, 8 * 1000 )
}
}else{
// 替换弹窗 直接确定
confirm = function(){return 1}
// alert('nb')
// 等待5秒后执行
setTimeout( function(){
try{
$("#mt-select-all").click();
}catch(err) {
document.getElementById("mt-select-all").click();
}
}, 5 * 1000 )
setTimeout(function(){
try{
$("#a-autoid-2-announce").click();
}catch(err){
document.getElementById("a-autoid-2-announce").click();
}
}, 6 * 1000 )
setTimeout( function(){
try{
for(var i=0;i < $('ul.a-nostyle.a-list-link li').length;i++){
if($("#dropdown1_" + String(i)).text().indexOf('删除商品') != -1 | $("#dropdown1_" + String(i)).text().indexOf('Delete products') != -1){
$("#dropdown1_" + String(i)).click()
}
}
}catch(err){
var ull = document.getElementsByClassName("a-nostyle a-list-link");
var lil = ull[0].getElementsByTagName('li');
for(var i=0;i < lil.length;i++){
console.log(lil[i].textContent)
if(lil[i].textContent.indexOf('删除商品') != -1 | lil[i].textContent.indexOf('Delete products') != -1){
document.getElementById("dropdown1_" + String(i)).click()
}
}
}
}, 7 * 1000 )
setTimeout( function(){
window.location.href = window.location.href.split('/').slice(0,3).join('/') + "/inventory"
}, 10 * 1000 )
}
}