842 shaares
111 private links
111 private links
3 results
tagged
Bookmarklet
ブックマークレット
ブラウザ内にテキストエリアを生成する。一時的なメモなどに。
data:text/html,%20<html%20style="background:rgb(12,12,12);color:rgb(210,210,210);text-align:center;"%20/><title>BrowserNote</title><h1%20style="font-size:120%;font-family:'Ubuntu%20Titling%20Rg';font-weight:bold;margin-top:5%;">Browser%20Note</h1><textarea%20style="background:rgb(20,20,20);color:rgb(210,210,210);line-height:1.5;width:80em;height:35em;border:none;outline:none;font-family:'Ricty%20Discord';margin:0%20auto%200;"%20autofocus%20/>
本体はdata:text/html,%20<html contenteditable>だけ。それ以降はCSSによるデザイン追加部分。
ブックマークレット。Firefoxで確認。
ページ内のカウントダウン/カウントアップ部分を選択するとタブ内にカウントが追加される。
公開していたサイト自体がなくなっていたので。
javascript:(function(){function%20Title(){function%20e(e){n.innerHTML='('+e+')%20'+o}function%20t(){n.innerHTML=o}var%20n=document.querySelector('title'),o=document.title;return{set:e,reset:t}}function%20Favicon(){function%20e(){i=document.createElement('canvas'),r=i.getContext('2d'),c=_el('link',{rel:'icon',type:'image/x-icon'}),document.head.appendChild(c),i.width=16,i.height=16}function%20t(e){o=100>e?11:1e3>e?10:8,r.clearRect(0,0,16,16),r.fillStyle='black',r.textAlign='center',r.font='bold%20'+o+'px%20Arial',r.fillText(e,8,12),c.href=i.toDataURL('image/png')}function%20n(){for(var%20e=document.querySelectorAll('link'),t=0;t<e.length;t++)['shortcut%20icon','icon','apple-touch-icon-precomposed'].indexOf(e[t].rel)>-1&&e[t].parentNode.removeChild(e[t])}var%20o,i,r,c;return%20n(),e(),{set:t}}function%20Style(){function%20e(){document.head.appendChild(i),i.sheet.insertRule('*%20{cursor:pointer}',0),i.sheet.insertRule('.tabc-highlight%20{background:%20rgba(48,%20128,%20226,%200.33);outline:%201px%20dashed%20rgb(48,128,226);position:%20absolute;width:%201px;height:%201px;z-index:%201000000;pointer-events:%20none;display:%20none;}',1)}function%20t(){document.head.appendChild(r),r.sheet.insertRule('.tabc-popup%20{font-size:%2014px;position:%20fixed;text-align:%20center;bottom:%200;right:%200;left:%200;z-index:%2010000000;background:%20rgb(223,%2063,%2063);color:%20#fff;padding:%2015px;}',0),r.sheet.insertRule('.tabc-popup%20a%20{color:%20#fff;text-decoration:%20underline}',1),r.sheet.insertRule('.tabc-popup%20a:hover%20{text-decoration:%20none;}',2),r.sheet.insertRule('.tabc-popup%20span%20{cursor:pointer;float:right;font-size:30px;line-height:0;bottom:-13px;position:relative;font-weight:bold;}',3)}function%20n(){document.head.removeChild(i)}function%20o(){document.head.removeChild(r)}var%20i=document.createElement('style'),r=document.createElement('style');return{injectHS:e,injectPS:t,removeHS:n,removePS:o}}function%20Watcher(){function%20e(e,c){o=e,i=c?'favicon':'title',r=['input','option','button','select','textarea'].indexOf(o.tagName.toLowerCase())>-1,TC.title.reset(),n=setInterval(t,1500)}function%20t(){TC[i].set(r?o.value:o.textContent)}var%20n,o,i,r;return{watch:e}}function%20Highlighter(){function%20e(){TC.style.injectHS(),c=_el('div',{className:'tabc-highlight'}),document.body.appendChild(c),i()}function%20t(e){return%20l==e.target?!1:(l=e.target,'iframe'==l.tagName.toLowerCase()&&(d.el=l),(l.ownerDocument.defaultView||l.ownerDocument.parentWindow).self!==window?(d.x=d.el.getBoundingClientRect().left,d.y=d.el.getBoundingClientRect().top):(d.x=0,d.y=0),c.style.width=l.offsetWidth+'px',c.style.height=l.offsetHeight+'px',c.style.top=l.getBoundingClientRect().top+window.scrollY+d.y+'px',c.style.left=l.getBoundingClientRect().left+window.scrollX+d.x+'px',void(c.style.display='block'))}function%20n(e){TC.watcher.watch(e.target,e.metaKey||e.ctrlKey),a&&a!=TC.version&&TC.popup.show(a),o(),e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}function%20o(){TC.style.removeHS(),document.body.removeChild(c),document.body.removeEventListener('keyup',TC.highlighter.close),document.body.removeEventListener('click',TC.highlighter.select),document.body.removeEventListener('mouseover',TC.highlighter.inspect)}function%20i(){if('https:'==location.protocol){var%20e=new%20Image;return%20void(e.src=TC.logUrl)}var%20t=new%20XMLHttpRequest;t.open('GET',TC.logUrl),t.onload=function(e){var%20t=JSON.parse(e.currentTarget.response||e.target.responseText);a=t.version},t.send()}function%20r(e){e.keyCode=o()}var%20c,l,a,d={};return%20e(),{inspect:t,select:n,remove:o,close:r}}function%20_el(e,t){var%20n=document.createElement(e);for(var%20o%20in%20t)t.hasOwnProperty(o)&&(n[o]=t[o]);return%20n}function%20Popup(){function%20e(e){TC.style.injectPS(),n=_el('div',{className:'tabc-popup',innerHTML:'Tab%20Counter%20update%20available.<b>'+TC.version+'</b>%20=>%20<b>'+e+'</b>.%20'+'Update%20now'.link('http://tabcounter.com')+'%20<span>%C3%97</span>'}),n.querySelector('span').addEventListener('click',TC.popup.hide),document.body.appendChild(n)}function%20t(){TC.style.removePS(),document.body.removeChild(n)}var%20n;return{show:e,hide:t}}var%20TC=window.TabCounter||{};TC.version='0.2.1',TC.logUrl='http://tabcounter.com/count.php?l=1',TC.popup=TC.popup||Popup(),TC.watcher=TC.watcher||Watcher(),TC.style=TC.style||Style(),TC.favicon=TC.favicon||Favicon(),TC.title=TC.title||Title(),TC.highlighter=Highlighter(),document.body.addEventListener('keyup',TC.highlighter.close),document.body.addEventListener('click',TC.highlighter.select),document.body.addEventListener('mouseover',TC.highlighter.inspect);for(var%20i=0;i<window.frames.length;i++)window.frames[i].document.body.addEventListener('keyup',TC.highlighter.close),window.frames[i].document.body.addEventListener('click',TC.highlighter.select),window.frames[i].document.body.addEventListener('mouseover',TC.highlighter.inspect);window.TabCounter=TC;})()