diff --git a/javascript/mainPage.js b/javascript/mainPage.js index 00d74c1..399b7a9 100644 --- a/javascript/mainPage.js +++ b/javascript/mainPage.js @@ -1,4 +1,13 @@ window.onload = function(){ +/* + const edgeAD = "ITIT_SapphireAppInstall_Announcement_amc_Default"; + const mStoreReminder = "ITIT_Lifecycle-Shop and Earn reminder"; + const setObjective = "ITIT_Lifecycle-Set a goal"; + const welcomeBonus = "ITIT_Lifecycle-Onboarding"; + const setAGoal = "ITIT_Lifecycle-Just set a goal"; +*/ + //Guessing that ITIT stands for my nationality (Italy), so i'm removing it from moreActivityCode const + const moreActivitiesCode = "moreactivities_offer"; //Creating custom button for the extension var menuContainer = document.getElementsByClassName('c-pivot pull-left')[0]; //grabbed column div for the play button @@ -13,11 +22,10 @@ window.onload = function(){ menuContainer.innerHTML += playItem; menuContainer.innerHTML += doSearches; - //Adding onclick event to the custom button document.getElementById("reward_pivot_collect").onclick = (function (){ if(document.getElementsByClassName('m-card-group')[0].getElementsByClassName('ng-scope ng-isolate-scope c-card ').length == 3){ - console.log("Entered IF"); + console.log("dailyActivities: ENTERED DAILY ACTIVITIES"); //enters if the 3 daily challenges are loaded document.getElementsByClassName('m-card-group')[0].getElementsByClassName('ng-scope ng-isolate-scope c-card ')[0].getElementsByTagName('a')[0].click(); document.getElementsByClassName('m-card-group')[0].getElementsByClassName('ng-scope ng-isolate-scope c-card ')[1].getElementsByTagName('a')[0].click(); @@ -28,15 +36,20 @@ window.onload = function(){ const container = document.getElementById("more-activities").children[0]; //check if "other activities" tab has anything in it (basically if it exists) if(container.childElementCount > 0){ + console.log("moreActivities: ENTERED MORE ACTIVITIES"); const numberOfItems = container.childElementCount; //usually 12 + console.log("moreActivities: NUMBER OF ITEMS="+numberOfItems); for(var i=0; i