// daily clear if((!localStorage.getItem('am_nextclear'))||(1localStorage.getItem('am_nextclear')<(new Date()).getTime())){ for(var i=localStorage.length-1;i>=0;i--){ var k=localStorage.key(i); if(k.indexOf('am__')!==0&&k.indexOf('am_')===0) localStorage.removeItem(k);//remove all non _ items } // calculate time for next clear var next=new Date(); next.setHours(4); next.setMinutes(0); localStorage.setItem('am_nextclear',next.getTime()+(2460601000)); localStorage.setItem('am_start',~~((new Date()).getTime()/1000)); }
//populate our data data={}; for(var i=localStorage.length-1;i>=0;i--){ var k=localStorage.key(i); if(k.indexOf('am_')===0) data[k.replace(/^am_/,'')]=localStorage.getItem(k); else localStorage.removeItem(k)//make sure localStorage will not get full }
// get hostname for postMessage protocol function getHostname(url){ return url.toString().replace(/^[^\/][/][/]/,'').replace(/^([^\/?#]).*$/,"$1"); }
var src; // allowed domains for postMessage protocol var p=location.href.toString().replace(/^[?#]/,'&'); // query parameters (location.search) if(/&src=/.test(p)) src=getHostname(p.split(/&src=/)[1].replace(/&.*$/,''));// when src param is set, update the allowed hostname accordingly
//////////////////////// ////// Verticals /////// //////////////////////// // // verticals_data_json
// send the local data to original window // note that src must start with 'http://' otherwise nothing works. unless it is just '' // window.parent.postMessage('XUEGr='+JSON.stringify(data),'');//src?'http://'+src:'*'
// support set_data using postMessage protocol listener var listener=function(e){ if(getHostname(e.origin)!==src||e.data.indexOf('am_')!==0||e.data.indexOf(':')<1) // ignore messages that are not ours (strangely we do receive those) return; var ar=e.data.split(':'); // parse the key:value if(ar[1]==='') localStorage.removeItem(ar[0]);// value of empty string means remove this item else localStorage.setItem(ar[0],ar[1]); }; if(window.addEventListener){ addEventListener("message",listener,false); }else{ attachEvent("onmessage",listener); } </script><script src="chrome-extension://lnkdbjbjpnpjeciipoaflmpcddinpjjp/mutationObserver.js"></script><script src="chrome-extension://lnkdbjbjpnpjeciipoaflmpcddinpjjp/mytube.js"></script>