4 ms·
This doesn't undo text selection disabled by following: http://www.rgagnon.com/jsdetails/js-0120.html http://www.rgagnon.com/jsdetails/js-0120.html.
by zerkten 9y ago
This doesn't undo text selection disabled by following: http://www.rgagnon.com/jsdetails/js-0120.html http://www.rgagnon.com/jsdetails/js-0120.html.
- retSava 9y agoThanks! Updated the bookmarklet (used both IE and FF methods from the link): javascript:(function(){function%20allowTextSelection(){document.onselectstart = null; document.onmousedown = null; document.onmouseup = null; 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();})();