Skip to content

Instantly share code, notes, and snippets.

View Mikeprod's full-sized avatar
💭
I may be slow to respond.

Mikeprod

💭
I may be slow to respond.
View GitHub Profile
@Mikeprod
Mikeprod / bookmark.js
Created December 29, 2024 17:25
Enable Selection Web Bookmark
javascript:(function(){function%20allowTextSelection(){window.console&&console.log('allowTextSelection');var%20style=document.createElement('style');style.type='text/css';style.innerHTML='*,p,div{user-select:text%20!important;-moz-user-select:text%20!important;-webkit-user-select:text%20!important;}';document.head.appendChild(style);var%20elArray=document.body.getElementsByTagName('*');for(var%20i=0;i<elArray.length;i++){var%20el=elArray[i];el.onselectstart=el.ondragstart=el.ondrag=el.oncontextmenu=el.onmousedown=el.onmouseup=function(){return%20true};if(el%20instanceof%20HTMLInputElement&&['text','password','email','number','tel','url'].indexOf(el.type.toLowerCase())>-1){el.removeAttribute('disabled');el.onkeydown=el.onkeyup=function(){return%20true};}}}allowTextSelection();})();
@Mikeprod
Mikeprod / SnippetHTML5Video.js
Last active April 28, 2024 00:18
Video controls HTML5
/* Makes the space key to play/pause the video and the + to speed up the video & - to slow the video by 25%*/
function checkVideo(doc){
var videos = doc.getElementsByTagName("video");
if(videos.length == 0){
return;
}
if(videos.length == 1){
return doc.getElementsByTagName("video")[0];