Skip to content

Instantly share code, notes, and snippets.

@crbyxwpzfl
Last active February 21, 2022 11:33
Show Gist options
  • Save crbyxwpzfl/4865ba51fcd0a4af660f09e0c5dbcf5e to your computer and use it in GitHub Desktop.
Save crbyxwpzfl/4865ba51fcd0a4af660f09e0c5dbcf5e to your computer and use it in GitHub Desktop.
js orientation-lock-ios-safari

js alert vids

javascript:( function(){
	var arr = [], l = document.getElementsByTagName('source');
	for(var i=0; i<l.length; i) { arr.push(l[i].src); }
	alert(arr);
} )();

js alert links

javascript:( function(){
	var arr = [], l = document.links; 
	for(var i=0; i<l.length; i) { arr.push(l[i].href); } 
	alert(arr);
} )();

js edit website

javascript:document.body.contentEditable = true; void 0;

js new tab with link

javascript:( function(){ var a=window.open('about:blank').document; a.write('
	<!DOCTYPE html>
		<html>
			<head><meta name="viewport" content="width=device-width" /></head>
			<body><p><a href="https://google.com">CLICKABLETEXT</a></p></body>
		</html>
');a.close(); })();

js show source code

javascript:( function(){
	var a=window.open('about:blank').document;
	a.write('<title>Source of '+location.href+'</title><meta name="viewport" content="width=device-width">');
	a.close();
	var b=a.body.appendChild(a.createElement('pre'));
	b.style.overflow='auto';
	b.style.whiteSpace='pre-wrap';
	b.appendChild(a.createTextNode(document.documentElement.innerHTML))
} )();

js for yt.com rotation-lock no-input-zoom p-in-p

javascript:( function(){ 
	var script = `window.addEventListener("orientationchange", function() {
		if (window.orientation == 90) {
			document.getElementsByTagName("ytd-app")[0].setAttribute( "style", "transform: rotate(-90deg); transform-origin: right top; width: 400px; zoom: 50%");
			document.getElementsByTagName("html")[0].setAttribute("style", "font-size: 5px;font-family: Roboto, Arial, sans-serif;");
		}; if (window.orientation == -90) {
			document.getElementsByTagName("ytd-app")[0].setAttribute("style", "transform: rotate(90deg) translateY(-100000px); transform-origin: left top; width: 400px; zoom: 50%");
			document.documentElement.scrollLeft = 0 + 100000;
			document.getElementsByTagName("html")[0].setAttribute("style", "font-size: 5px;font-family: Roboto, Arial, sans-serif;");
		}; if (window.orientation == 0) {
			document.getElementsByTagName("ytd-app")[0].setAttribute("style", "zoom: 100%");
			document.getElementsByTagName("html")[0].setAttribute("style", "font-size: 12px;font-family: Roboto, Arial, sans-serif;");
		}
	}); `;
	var scriptsheet = document.createElement("script");
	scriptsheet.innerText = script;
	document.head.appendChild(scriptsheet);
	
	document.getElementsByTagName("Input")[0].setAttribute("style", "outline: none; font-size: 21px;");
	
	let v= document.querySelector('video');
	v.addEventListener('webkitpresentationmodechanged',(e)=>e.stopPropagation(), true); 
	setTimeout(()=>v.webkitSetPresentationMode('picture-in-picture'), 3000);completion()
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment