Greasy Fork

Greasy Fork is available in English.

AMZ - SKU Delete

7/5/2021, 3:41:36 AM

当前为 2022-01-20 提交的版本,查看 最新版本

// ==UserScript==
// @name        AMZ - SKU Delete
// @namespace   Violentmonkey Scripts
// @match       https://sellercentral.amazon.*/inventory*
// @grant       none
// @version     1.3.1
// @author      -
// @license     Eveny One
// @description 7/5/2021, 3:41:36 AM
// ==/UserScript==

window.onload = function(){
  url = window.location.href
  if(/confirmAction/.test(url)){
    hh = $("#interStitialPageMessage").html();
    Num = hh.match(/\d+/);
    if(Number(Num) == 0){
      alert("当前产品数为0,停止操作")
    }else{
      setTimeout( function(){
        $("#interstitialPageContinue").click();
      }, 3 * 1000 )

      setTimeout( function(){
        $("#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(){
      $("#mt-select-all").click();
    }, 5 * 1000 )

    setTimeout(function(){
      $("#a-autoid-1-announce").click();
    }, 6 * 1000 )

    setTimeout(function(){
      $("#a-autoid-2-announce").click();
    }, 6 * 1000 )

    setTimeout( function(){
      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()
        }
      }
    }, 7 * 1000 )

    setTimeout( function(){
      window.location.href = window.location.href.split('/').slice(0,3).join('/') + "/inventory"
    }, 10 * 1000 )
  }
}