24. Full Screen ChromeWebStore v2- Po wejściu na stronę Chrome Web Store z rozszerzeniami i kliknięciu na skryptozakładkę, od tego momentu, obrazki na stronie rozszerzenia pokazuje na pełny ekran.
Kod:
javascript:(function(){const c=(t,p={})=>{const e=document.createElement(t);Object.assign(e.style,p);return e};const o=c('div',{position:'fixed',top:'0',left:'0',width:'100vw',height:'100vh',backgroundColor:'rgba(0,0,0,0.95)',zIndex:'2147483647',display:'none',justifyContent:'center',alignItems:'center',userSelect:'none'});const i=c('img',{maxWidth:'95%',maxHeight:'95%',objectFit:'contain',boxShadow:'0 0 30px #000',cursor:'pointer'});const p=c('div',{position:'absolute',left:'20px',color:'#fff',fontSize:'60px',cursor:'pointer',padding:'30px',zIndex:'2147483648',background:'rgba(0,0,0,0.2)',borderRadius:'10px'});p.textContent='❮';const n=c('div',{position:'absolute',right:'20px',color:'#fff',fontSize:'60px',cursor:'pointer',padding:'30px',zIndex:'2147483648',background:'rgba(0,0,0,0.2)',borderRadius:'10px'});n.textContent='❯';const t=c('div',{position:'absolute',bottom:'20px',color:'#fff',fontSize:'18px',fontFamily:'sans-serif'});o.append(p,i,n,t);document.body.appendChild(o);let s=[],d=0;const u=(x)=>{if(x<0)x=s.length-1;if(x>=s.length)x=0;d=x;i.src=s[d];t.textContent=(d+1)+' / '+s.length};p.onclick=(e)=>{e.stopPropagation();u(d-1)};n.onclick=(e)=>{e.stopPropagation();u(d+1)};o.onclick=()=>{o.style.display='none';i.src=''};i.onclick=(e)=>e.stopPropagation();window.addEventListener('keydown',(e)=>{if(o.style.display==='flex'){if(e.key==='ArrowLeft')u(d-1);if(e.key==='ArrowRight')u(d+1);if(e.key==='Escape')o.style.display='none'}});document.addEventListener('click',(e)=>{const r=e.target.closest('img');if(r&&r.src.includes('googleusercontent.com')&&r.offsetHeight>100){e.preventDefault();e.stopPropagation();let g=r.closest('[role="list"]')||r.closest('section')||r.parentElement;const all=Array.from(g.querySelectorAll('img[src*="googleusercontent.com"]')).filter(m=>m.offsetHeight>100);const unique={};all.forEach(m=>{const base=m.src.split('=')[0];if(!unique[base])unique[base]=base+'=s0'});s=Object.values(unique);const clickedBase=r.src.split('=')[0];d=s.findIndex(url=>url.startsWith(clickedBase));if(d===-1)d=0;o.style.display='flex';u(d)}},true);const m=c('div',{position:'fixed',top:'20px',left:'50%',transform:'translateX(-50%)',background:'#4caf50',color:'#fff',padding:'10px 20px',zIndex:'999999',borderRadius:'5px',fontFamily:'sans-serif'});m.textContent='V7: Poprawiony licznik';document.body.appendChild(m);setTimeout(()=>m.remove(),2000);})();