kalpdev.1 / Error reduction

// ==UserScript==
// @name     Error reduction
// @author   shjaisw
// @run-at   document-end
// @match    https://argus.aka.amazon.com/*
// @include  https://argus.aka.amazon.com/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant    GM_addStyle
// @updateURL https://openuserjs.org/meta/kalpdev.1/Error_reduction.meta.js
// @downloadURL https://openuserjs.org/install/kalpdev.1/Error_reduction.user.js

// @match    http://pnq-412gv7q.ant.amazon.com:8087/*
// @grant    GM_xmlhttpRequest
// @grant    GM_registerMenuCommand
// @grant    GM_setValue
// @grant    GM_getValue
// @license MIT
// ==/UserScript==



function addCustomSearchResult (jNode) {
    //$(".submit-product-card-classification").hide ();

    $('.submit-product-card-classification').click(function(){
        //$('md-tab-item[aria-label="Extended battery attributes from the catalog"]').trigger('click');

	setTimeout(function(){ add_description();   }, 200);

	function add_description(){
       
        $('md-tab-item[aria-label="Extended battery attributes from the catalog"]').trigger('click');

       setTimeout(function(){ var n = attribute(); console.log("Str is : " + n); var keyword = "American"; if(n.includes("lithium_polymer")==true || n.includes("lithium_ion") || n.includes("lithium_metal")==true || n.includes("lithium_manganese_dioxide") || n.includes("lithium")==true || n.includes("cr2") || n.includes("cr123a")==true || n.includes("cr123") || n.includes("LiMnO2")==true || n.includes("batteries_packed_with_equipment") || n.includes("batteries_contained_in_equipment")==true || n.includes("batteries_only")) { swal({ title: "Check Extended Attributes!", text: "If it has Battery Chemistry", icon: "info", button: "Aww yiss!", });; } }, 1000);
         function attribute(){
             var active_data7= $('.ng-scope').text();
             //console.log("Battery string is : " + active_data7);
             return (active_data7);
           }

        ////var active_data = $('.ng-isolate-scope').text();
        //console.log("Active string is : " + active_data);

        ////var batt = $('.md-dg-theme').text();
        ////console.log("Bat Attri is : " + batt);
	}


    });
}


var url= window.location.href;
var isArgusDG = /^https:\/\/argus.aka.amazon.com\/#!\/dg(.*)/i.test(url);

if (isArgusDG){
    console.log("This is an Argus DG Page!");
              waitForKeyElements (".submit-product-card-classification", addCustomSearchResult);
}else{
    console.log("This is not an Argus DG Page!");
}