Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:(function(){function showToast(message,isError){const existingToast=document.getElementById('nitter-toast');if(existingToast){existingToast.remove();}const toast=document.createElement('div');toast.id='nitter-toast';toast.style.position='fixed';toast.style.bottom='20px';toast.style.right='20px';toast.style.padding='10px 15px';toast.style.borderRadius='4px';toast.style.zIndex='9999';toast.style.fontSize='14px';toast.style.fontWeight='bold';if(isError){toast.style.backgroundColor='rgba(220,0,0,0.9)';}else{toast.style.backgroundColor='rgba(0,128,0,0.9)';}toast.style.color='white';toast.style.boxShadow='0 2px 5px rgba(0,0,0,0.3)';toast.textContent=message;document.body.appendChild(toast);setTimeout(()=>{if(toast.parentNode){toast.remove();}},3000);}const form=document.querySelector('form[action="/saveprefs"]');if(!form){showToast('This doesn\'t appear to be a Nitter instance',true);return;}const formData=new FormData(form);const settings={theme:'Nitter',infiniteScroll:'on',stickyProfile:'on',mp4Playback:'on',hlsPlayback:'on',autoplayGifs:'on'};for(const[key,value]of Object.entries(settings)){formData.set(key,value);}const params=new URLSearchParams();for(const[key,value]of formData.entries()){params.append(key,value);}const formAction=form.getAttribute('action')||'/saveprefs';showToast('Saving preferences...',false);fetch(formAction,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'},body:params.toString(),credentials:'include'}).then(response=>{if(response.ok){showToast('Preferences saved successfully!',false);setTimeout(()=>window.location.reload(),1000);}else{showToast('Failed to save preferences (Status: '+response.status+')',true);}}).catch(error=>{showToast('Error: '+error.message,true);console.error('Nitter preferences error:',error);});})();
Advertisement
Add Comment
Please, Sign In to add comment