Stalkyyy

Make kanji big (bookmarklets)

Mar 5th, 2020
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. javascript:void%20function(){function%20e(e){try{var%20t,n;t=document.getElementsByTagName(%22head%22)[0],n=document.createElement(%22style%22),n.type=%22text/css%22,t.appendChild(n),n.innerHTML=e}catch(u){document.styleSheets.length||document.createStyleSheet(),document.styleSheets[0].cssText+=e}}var%20t=%22kanjibigifier%22,n=[%22.%22+t+%22%20{%22,%22font-size:%2024px;%22,%22}%22].join(%22%22),u=%22//text()[not(ancestor::script)%20and%20not(ancestor::style)]%22,a=/([\u2E80-\u2EFF\u2F00-\u2FDF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF]+)/g;e(n);for(var%20d=document.evaluate(u,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null),o=d.snapshotLength-1;o%3E=0;o--){var%20s=d.snapshotItem(o);if(a.test(s.nodeValue)){var%20c=document.createElement(%22span%22),l=s.nodeValue;s.parentNode.replaceChild(c,s),a.lastIndex=0;for(var%20r=null,i=0;r=a.exec(l);){c.appendChild(document.createTextNode(l.substring(i,r.index)));var%20m=document.createElement(%22span%22);m.setAttribute(%22class%22,t),m.appendChild(document.createTextNode(r[0])),c.appendChild(m),i=a.lastIndex}c.appendChild(document.createTextNode(l.substring(i))),c.normalize()}}}();
Add Comment
Please, Sign In to add comment