/
main.js
215 lines (175 loc) · 19.8 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// var gapi=window.gapi=window.gapi||{};gapi._bs=new Date().getTime();(function(){var g=function(){this.g=""};g.prototype.toString=function(){return"SafeScript{"+this.g+"}"};g.prototype.a=function(a){this.g=a};(new g).a("");var h=function(){this.j=""};h.prototype.toString=function(){return"SafeStyle{"+this.j+"}"};h.prototype.a=function(a){this.j=a};(new h).a("");var m=function(){this.i=""};m.prototype.toString=function(){return"SafeStyleSheet{"+this.i+"}"};m.prototype.a=function(a){this.i=a};(new m).a("");var n=function(){this.f=""};n.prototype.toString=function(){return"SafeHtml{"+this.f+"}"};n.prototype.a=function(a){this.f=a};(new n).a("<!DOCTYPE html>");(new n).a("");(new n).a("<br>");/*
// gapi.loader.OBJECT_CREATE_TEST_OVERRIDE &&*/
// var q=window,v=document,aa=q.location,ba=function(){},ca=/\[native code\]/,x=function(a,b,c){return a[b]=a[b]||c},da=function(a){a=a.sort();for(var b=[],c=void 0,d=0;d<a.length;d++){var e=a[d];e!=c&&b.push(e);c=e}return b},y=function(){var a;if((a=Object.create)&&ca.test(a))a=a(null);else{a={};for(var b in a)a[b]=void 0}return a},D=x(q,"gapi",{});var E;E=x(q,"___jsl",y());x(E,"I",0);x(E,"hel",10);var F=function(){var a=aa.href;if(E.dpo)var b=E.h;else{b=E.h;var c=/([#].*&|[#])jsh=([^&#]*)/g,d=/([?#].*&|[?#])jsh=([^&#]*)/g;if(a=a&&(c.exec(a)||d.exec(a)))try{b=decodeURIComponent(a[2])}catch(e){}}return b},fa=function(a){var b=x(E,"PQ",[]);E.PQ=[];var c=b.length;if(0===c)a();else for(var d=0,e=function(){++d===c&&a()},f=0;f<c;f++)b[f](e)},G=function(a){return x(x(E,"H",y()),a,y())};var H=x(E,"perf",y()),K=x(H,"g",y()),ha=x(H,"i",y());x(H,"r",[]);y();y();var L=function(a,b,c){var d=H.r;"function"===typeof d?d(a,b,c):d.push([a,b,c])},N=function(a,b,c){b&&0<b.length&&(b=M(b),c&&0<c.length&&(b+="___"+M(c)),28<b.length&&(b=b.substr(0,28)+(b.length-28)),c=b,b=x(ha,"_p",y()),x(b,c,y())[a]=(new Date).getTime(),L(a,"_p",c))},M=function(a){return a.join("__").replace(/\./g,"_").replace(/\-/g,"_").replace(/,/g,"_")};var O=y(),R=[],S=function(a){throw Error("Bad hint"+(a?": "+a:""));};R.push(["jsl",function(a){for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b)){var c=a[b];"object"==typeof c?E[b]=x(E,b,[]).concat(c):x(E,b,c)}if(b=a.u)a=x(E,"us",[]),a.push(b),(b=/^https:(.*)$/.exec(b))&&a.push("http:"+b[1])}]);var ia=/^(\/[a-zA-Z0-9_\-]+)+$/,T=[/\/amp\//,/\/amp$/,/^\/amp$/],ja=/^[a-zA-Z0-9\-_\.,!]+$/,ka=/^gapi\.loaded_[0-9]+$/,la=/^[a-zA-Z0-9,._-]+$/,pa=function(a,b,c,d){var e=a.split(";"),f=e.shift(),l=O[f],k=null;l?k=l(e,b,c,d):S("no hint processor for: "+f);k||S("failed to generate load url");b=k;c=b.match(ma);(d=b.match(na))&&1===d.length&&oa.test(b)&&c&&1===c.length||S("failed sanity: "+a);return k},ra=function(a,b,c,d){a=qa(a);ka.test(c)||S("invalid_callback");b=U(b);d=d&&d.length?U(d):null;var e=
// function(f){return encodeURIComponent(f).replace(/%2C/g,",")};return[encodeURIComponent(a.pathPrefix).replace(/%2C/g,",").replace(/%2F/g,"/"),"/k=",e(a.version),"/m=",e(b),d?"/exm="+e(d):"","/rt=j/sv=1/d=1/ed=1",a.b?"/am="+e(a.b):"",a.l?"/rs="+e(a.l):"",a.o?"/t="+e(a.o):"","/cb=",e(c)].join("")},qa=function(a){"/"!==a.charAt(0)&&S("relative path");for(var b=a.substring(1).split("/"),c=[];b.length;){a=b.shift();if(!a.length||0==a.indexOf("."))S("empty/relative directory");else if(0<a.indexOf("=")){b.unshift(a);
// break}c.push(a)}a={};for(var d=0,e=b.length;d<e;++d){var f=b[d].split("="),l=decodeURIComponent(f[0]),k=decodeURIComponent(f[1]);2==f.length&&l&&k&&(a[l]=a[l]||k)}b="/"+c.join("/");ia.test(b)||S("invalid_prefix");c=0;for(d=T.length;c<d;++c)T[c].test(b)&&S("invalid_prefix");c=V(a,"k",!0);d=V(a,"am");e=V(a,"rs");a=V(a,"t");return{pathPrefix:b,version:c,b:d,l:e,o:a}},U=function(a){for(var b=[],c=0,d=a.length;c<d;++c){var e=a[c].replace(/\./g,"_").replace(/-/g,"_");la.test(e)&&b.push(e)}return b.join(",")},
// V=function(a,b,c){a=a[b];!a&&c&&S("missing: "+b);if(a){if(ja.test(a))return a;S("invalid: "+b)}return null},oa=/^https?:\/\/[a-z0-9_.-]+\.google(rs)?\.com(:\d+)?\/[a-zA-Z0-9_.,!=\-\/]+$/,na=/\/cb=/g,ma=/\/\//g,sa=function(){var a=F();if(!a)throw Error("Bad hint");return a};O.m=function(a,b,c,d){(a=a[0])||S("missing_hint");return"https://apis.google.com"+ra(a,b,c,d)};var W=decodeURI("%73cript"),X=/^[-+_0-9\/A-Za-z]+={0,2}$/,Y=function(a,b){for(var c=[],d=0;d<a.length;++d){var e=a[d],f;if(f=e){a:{for(f=0;f<b.length;f++)if(b[f]===e)break a;f=-1}f=0>f}f&&c.push(e)}return c},Z=function(){var a=E.nonce;return void 0!==a?a&&a===String(a)&&a.match(X)?a:E.nonce=null:v.querySelector?(a=v.querySelector("script[nonce]"))?(a=a.nonce||a.getAttribute("nonce")||"",a&&a===String(a)&&a.match(X)?E.nonce=a:E.nonce=null):null:null},ua=function(a){if("loading"!=v.readyState)ta(a);
// else{var b=Z(),c="";null!==b&&(c=' nonce="'+b+'"');a="<"+W+' src="'+encodeURI(a)+'"'+c+"></"+W+">";v.write(a)}},ta=function(a){var b=v.createElement(W);b.setAttribute("src",a);a=Z();null!==a&&b.setAttribute("nonce",a);b.async="true";(a=v.getElementsByTagName(W)[0])?a.parentNode.insertBefore(b,a):(v.head||v.body||v.documentElement).appendChild(b)},va=function(a,b){var c=b&&b._c;if(c)for(var d=0;d<R.length;d++){var e=R[d][0],f=R[d][1];f&&Object.prototype.hasOwnProperty.call(c,e)&&f(c[e],a,b)}},xa=function(a,
// b,c){wa(function(){var d=b===F()?x(D,"_",y()):y();d=x(G(b),"_",d);a(d)},c)},za=function(a,b){var c=b||{};"function"==typeof b&&(c={},c.callback=b);va(a,c);b=a?a.split(":"):[];var d=c.h||sa(),e=x(E,"ah",y());if(e["::"]&&b.length){a=[];for(var f=null;f=b.shift();){var l=f.split(".");l=e[f]||e[l[1]&&"ns:"+l[0]||""]||d;var k=a.length&&a[a.length-1]||null,w=k;k&&k.hint==l||(w={hint:l,c:[]},a.push(w));w.c.push(f)}var z=a.length;if(1<z){var A=c.callback;A&&(c.callback=function(){0==--z&&A()})}for(;b=a.shift();)ya(b.c,
// c,b.hint)}else ya(b||[],c,d)},ya=function(a,b,c){a=da(a)||[];var d=b.callback,e=b.config,f=b.timeout,l=b.ontimeout,k=b.onerror,w=void 0;"function"==typeof k&&(w=k);var z=null,A=!1;if(f&&!l||!f&&l)throw"Timeout requires both the timeout parameter and ontimeout parameter to be set";k=x(G(c),"r",[]).sort();var P=x(G(c),"L",[]).sort(),I=[].concat(k),ea=function(u,B){if(A)return 0;q.clearTimeout(z);P.push.apply(P,p);var C=((D||{}).config||{}).update;C?C(e):e&&x(E,"cu",[]).push(e);if(B){N("me0",u,I);try{xa(B,
// c,w)}finally{N("me1",u,I)}}return 1};0<f&&(z=q.setTimeout(function(){A=!0;l()},f));var p=Y(a,P);if(p.length){p=Y(a,k);var r=x(E,"CP",[]),t=r.length;r[t]=function(u){if(!u)return 0;N("ml1",p,I);var B=function(J){r[t]=null;ea(p,u)&&fa(function(){d&&d();J()})},C=function(){var J=r[t+1];J&&J()};0<t&&r[t-1]?r[t]=function(){B(C)}:B(C)};if(p.length){var Q="loaded_"+E.I++;D[Q]=function(u){r[t](u);D[Q]=null};a=pa(c,p,"gapi."+Q,k);k.push.apply(k,p);N("ml0",p,I);b.sync||q.___gapisync?ua(a):ta(a)}else r[t](ba)}else ea(p)&&
// d&&d()};var wa=function(a,b){if(E.hee&&0<E.hel)try{return a()}catch(c){b&&b(c),E.hel--,za("debug_error",function(){try{window.___jsl.hefn(c)}catch(d){throw c;}})}else try{return a()}catch(c){throw b&&b(c),c;}};D.load=function(a,b){return wa(function(){return za(a,b)})};K.bs0=window.gapi._bs||(new Date).getTime();L("bs0");K.bs1=(new Date).getTime();L("bs1");delete window.gapi._bs;}).call(this);
// gapi.load("",{callback:window["gapi_onload"],_c:{"jsl":{"ci":{"deviceType":"desktop","oauth-flow":{"authUrl":"https://accounts.google.com/o/oauth2/auth","proxyUrl":"https://accounts.google.com/o/oauth2/postmessageRelay","disableOpt":true,"idpIframeUrl":"https://accounts.google.com/o/oauth2/iframe","usegapi":false},"debug":{"reportExceptionRate":0.05,"forceIm":false,"rethrowException":false,"host":"https://apis.google.com"},"enableMultilogin":true,"googleapis.config":{"auth":{"useFirstPartyAuthV2":true}},"isPlusUser":false,"inline":{"css":1},"disableRealtimeCallback":false,"drive_share":{"skipInitCommand":true},"csi":{"rate":0.01},"client":{"cors":false},"isLoggedIn":true,"signInDeprecation":{"rate":0.0},"include_granted_scopes":true,"llang":"en","iframes":{"youtube":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/youtube?usegapi\u003d1","methods":["scroll","openwindow"]},"ytsubscribe":{"url":"https://www.youtube.com/subscribe_embed?usegapi\u003d1"},"plus_circle":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/plus/circle?usegapi\u003d1"},"plus_share":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/+1/sharebutton?plusShare\u003dtrue\u0026usegapi\u003d1"},"rbr_s":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/render/recobarsimplescroller"},":source:":"3p","playemm":{"url":"https://play.google.com/work/embedded/search?usegapi\u003d1\u0026usegapi\u003d1"},"savetoandroidpay":{"url":"https://pay.google.com/gp/v/widget/save"},"blogger":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/blogger?usegapi\u003d1","methods":["scroll","openwindow"]},"evwidget":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/events/widget?usegapi\u003d1"},"partnersbadge":{"url":"https://www.gstatic.com/partners/badge/templates/badge.html?usegapi\u003d1"},"dataconnector":{"url":"https://dataconnector.corp.google.com/:session_prefix:ui/widgetview?usegapi\u003d1"},"surveyoptin":{"url":"https://www.google.com/shopping/customerreviews/optin?usegapi\u003d1"},":socialhost:":"https://apis.google.com","shortlists":{"url":""},"hangout":{"url":"https://talkgadget.google.com/:session_prefix:talkgadget/_/widget"},"plus_followers":{"params":{"url":""},"url":":socialhost:/_/im/_/widget/render/plus/followers?usegapi\u003d1"},"post":{"params":{"url":""},"url":":socialhost:/:session_prefix::im_prefix:_/widget/render/post?usegapi\u003d1"},":gplus_url:":"https://plus.google.com","signin":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/signin?usegapi\u003d1","methods":["onauth"]},"rbr_i":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/render/recobarinvitation"},"donation":{"url":"https://onetoday.google.com/home/donationWidget?usegapi\u003d1"},"share":{"url":":socialhost:/:session_prefix::im_prefix:_/widget/render/share?usegapi\u003d1"},"plusone":{"params":{"count":"","size":"","url":""},"url":":socialhost:/:session_prefix::se:_/+1/fastbutton?usegapi\u003d1"},"comments":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/comments?usegapi\u003d1","methods":["scroll","openwindow"]},":im_socialhost:":"https://plus.googleapis.com","backdrop":{"url":"https://clients3.google.com/cast/chromecast/home/widget/backdrop?usegapi\u003d1"},"visibility":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/visibility?usegapi\u003d1"},"autocomplete":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/autocomplete"},"additnow":{"url":"https://apis.google.com/marketplace/button?usegapi\u003d1","methods":["launchurl"]},":signuphost:":"https://plus.google.com","ratingbadge":{"url":"https://www.google.com/shopping/customerreviews/badge?usegapi\u003d1"},"appcirclepicker":{"url":":socialhost:/:session_prefix:_/widget/render/appcirclepicker"},"follow":{"url":":socialhost:/:session_prefix:_/widget/render/follow?usegapi\u003d1"},"community":{"url":":ctx_socialhost:/:session_prefix::im_prefix:_/widget/render/community?usegapi\u003d1"},"sharetoclassroom":{"url":"https://www.gstatic.com/classroom/sharewidget/widget_stable.html?usegapi\u003d1"},"ytshare":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/ytshare?usegapi\u003d1"},"plus":{"url":":socialhost:/:session_prefix:_/widget/render/badge?usegapi\u003d1"},"family_creation":{"params":{"url":""},"url":"https://families.google.com/webcreation?usegapi\u003d1\u0026usegapi\u003d1"},"commentcount":{"url":":socialhost:/:session_prefix:_/widget/render/commentcount?usegapi\u003d1"},"configurator":{"url":":socialhost:/:session_prefix:_/plusbuttonconfigurator?usegapi\u003d1"},"zoomableimage":{"url":"https://ssl.gstatic.com/microscope/embed/"},"appfinder":{"url":"https://gsuite.google.com/:session_prefix:marketplace/appfinder?usegapi\u003d1"},"savetowallet":{"url":"https://pay.google.com/gp/v/widget/save"},"person":{"url":":socialhost:/:session_prefix:_/widget/render/person?usegapi\u003d1"},"savetodrive":{"url":"https://drive.google.com/savetodrivebutton?usegapi\u003d1","methods":["save"]},"page":{"url":":socialhost:/:session_prefix:_/widget/render/page?usegapi\u003d1"},"card":{"url":":socialhost:/:session_prefix:_/hovercard/card"}}},"h":"m;/_/scs/apps-static/_/js/k\u003doz.gapi.en.y5hhWjOdu80.O/am\u003dwQE/d\u003d1/rs\u003dAGLTcCNsKzxWFhezE2KkFP7auTmVDBiNEQ/m\u003d__features__","u":"https://apis.google.com/js/api.js","hee":true,"fp":"022853cbe6e85d177a0c3bee60e36925e44c0f39","dpo":false},"fp":"022853cbe6e85d177a0c3bee60e36925e44c0f39","annotation":["interactivepost","recobar","signin2","autocomplete","profile"],"bimodal":["signin","share"]}});
// //hackathon (newcourt)
// //idea: yt extension --> have videos on watch next/recommended to 'hover' dates or print in box;
// //approach:
// //(1) 'scrape' web page (of video we're on) for recommended IDs;
// //it's located in class'ytd-watch-next-secondary-results-render'
// //ytd-compact-radio-renderer (tag)
// //ytd-compact-video-renderer (tag)
// <script src="https://apis.google.com/js/api.js"></script>
/**
* Sample JavaScript code for youtube.videos.list
* See instructions for running APIs Explorer code samples locally:
* https://developers.google.com/explorer-help/guides/code_samples#javascript
*/
// function authenticate() {
// return gapi.auth2.getAuthInstance()
// .signIn({scope: "https://www.googleapis.com/auth/youtube.readonly"})
// .then(function() { console.log("Sign-in successful"); },
// function(err) { console.error("Error signing in", err); });
// }
// function loadClient() {
// gapi.client.setApiKey("AIzaSyCvURzZN9N_soKNHmiTE5DCKR2_CupZUHA");
// return gapi.client.load("https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest")
// .then(function() { console.log("GAPI client loaded for API"); },
// function(err) { console.error("Error loading GAPI client for API", err); });
// }
// // Make sure the client is loaded and sign-in is complete before calling this method.
// function execute() {
// return gapi.client.youtube.videos.list({
// "part": "snippet",
// "id": "-N0LT3NWyqI,hHW1oY26kxQ,EcEMX-63PKY,giouzUH5rOc,xLetZ-36TYs&t=1123s,I8_2hPjljag,-FlxM_0S2lA,A9sOb_r6Hy0,YKXPlkhLIPw,6u5a7_-a3vM,bebuiaSKtU4,F0IbjVq-fgs,B8tQ8RUbTW8,IjWfwkLSKtA,fA551WpQaO4,TRgAfvzHdT8,GGBm9gTY2NU,A6eupBe1c6I,TmYcoozFYnU,bQzIQa5YKvw"
// })
// .then(function(response) {
// // Handle the results here (response.result has the parsed body).
// console.log("Response", response);
// },
// function(err) { console.error("Execute error", err); });
// }
// gapi.load("client:auth2", function() {
// gapi.auth2.init({client_id: "YOUR_CLIENT_ID"});
// });
// // <button onclick="authenticate().then(loadClient)">authorize and load</button>
// // <button onclick="execute()">execute</button>
// Assembled using examples:
// https://github.com/google/google-api-javascript-client/blob/master/docs/samples.md
// https://github.com/google/google-api-javascript-client/blob/master/docs/start.md
// function xxx() {
// gapi.load('', start)
// }
//
// function start() {
// // Initializes the client with the API key and the Translate API.
// debugger;
// gapi.client.init({
// 'apiKey': 'AIzaSyCvURzZN9N_soKNHmiTE5DCKR2_CupZUHA',
// 'discoveryDocs': ['https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest'],
// }).then(function() {
// // Executes an API request, and returns a Promise.
// // The method name `language.translations.list` comes from the API discovery.
// return gapi.client.youtube.videos.list({
// "part": "snippet",
// "id": "-N0LT3NWyqI,hHW1oY26kxQ,EcEMX-63PKY,giouzUH5rOc,xLetZ-36TYs&t=1123s,I8_2hPjljag,-FlxM_0S2lA,A9sOb_r6Hy0,YKXPlkhLIPw,6u5a7_-a3vM,bebuiaSKtU4,F0IbjVq-fgs,B8tQ8RUbTW8,IjWfwkLSKtA,fA551WpQaO4,TRgAfvzHdT8,GGBm9gTY2NU,A6eupBe1c6I,TmYcoozFYnU,bQzIQa5YKvw"
// });
// }).then(function(response) {
// console.log(response.result.data.translations[0].translatedText);
// }, function(reason) {
// console.log('Error: ' + reason.result.error.message);
// });
// };
// window.onload = function() {
// alert('Ready');
// //Send a message
// sendMessage();
// }
//Get message from background page
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
// debugger;
//Alert the message
renderDates(request.data, nodeList);
// alert("I'm main.js I just heard from background and I thought I'd tell you about : " + request.greeting);//You have to choose which part of the response you want to display ie. request.greeting
//Construct & send a response
});
//Send message to background page
function sendMessage(list) {
//Construct & send message
chrome.runtime.sendMessage({list:list}, function() {
// debugger;
// alert("I'm the background.js main.js told me to tell you: " + arguments);//You have to choose which part of the response you want to display ie. response.response
});
}
function renderDates(jsoninfo, vidnodelist){
console.log(jsoninfo);
console.log(vidnodelist)
// info is a (fake) JSON response with data on all our recommended ids
for (let item of jsoninfo.items) {
let id = item.id;
// console.log(`ITEM: ${item}`)
let date = item.snippet.publishedAt;
let dateObj = new Date (date)
date = dateObj.toDateString().slice(4);
//if videos[id] === vidnodelist items, append videos[publishedat] inside its div;
//look to nodelist that matches id, paste its date in it;
for (let vid of vidnodelist) {
let link = vid.getAttribute('href').split("v=")[1]
// console.log('item id:', item.id)
// console.log('link:' + link)
if (item.id === link) {
//put date here
// console.log('match', vid)
vid.appendChild(document.createTextNode(date));
vid.style.fontSize = "12px";
vid.style.color = "red";
}
}
}
}
let weGotIt =function (message){
alert("oh fuck yea");
}
// chrome.runtime.sendMessage("hello");
// chrome.runtime.sendMessage({greeting: "hello"});
let getDates = function(IDList){
sendMessage(IDList);
// chrome.tabs.getCurrent(function (tab){console.log(tab)});
}
const targetNode = document.getElementById('related');
const sidebarVideos = [];
let nodeList;
const config = {attributes: true, childlist: true, subtree: true};
let makeIDListCalled = 0;
let IDList = [];
function makeIDList(arr) {
makeIDListCalled++;
if (makeIDListCalled<=1){
console.log(arr);
for (let obj of arr) {
let sliced = obj.search.replace(/\?v=/, "").split(/\&t=/)[0];
IDList.push(sliced);
}
console.log(IDList);
getDates(IDList);
}
}
const callback = function(mutationList, observer) {
for (let mutation of mutationList) {
if (mutation.type === 'attributes' && mutation.target.className === 'video-skeleton hidden') {
nodeList = document.querySelectorAll('.yt-simple-endpoint.style-scope.ytd-compact-video-renderer'); //this works, but executes faster than the page loads and will return 0 nodes;
if (nodeList.length>14){
makeIDList(nodeList);
}
}
}
}
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
// console.log(videoLinks);
// $(window).bind("load", () => {
// console.log(document.querySelectorAll('.style-scope ytd-compact-video-renderer'))
// })
// console.log(document.querySelectorAll('.style-scope ytd-compact-video-renderer')); //this works, but executes faster than the page loads and will return 0 nodes;
//...vi/YT_ID_HERE/hqd...
//(2) YT API --> input IDs into search and populate data
//should search for date created and return those dates in order to us
//(3) Append the API's results (dates) to the Original page's recommended videos (in order)