단어의 앞쪽만 볼드체로 바꿔주면 신기하게 잘 읽힙니다.
페이스북 같은 가상DOM 기반의 페이지에는 정상동작하지 않습니다.
// https://xeno.work/readhack.html
// Author : shj at xenosi dot de
// License : MIT
(function(d) {
function r(obj) {
if (obj.nodeType == 1 && obj.childNodes.length) {
[...obj.childNodes].forEach(o => r(o));
return;
}
if (obj.nodeType == 3) {
const span = d.createElement('span');
span.innerHTML = obj.nodeValue.replace(/[^\s\p{M}\p{P}\p{S}\p{Z}\p{C}]+/ug, $0 => {
let str = Array.from($0), idx = Math.ceil(str.length / 2);
return '<strong>' + str.slice(0, idx).join('') + '</strong>' + str.slice(idx).join('');
});
obj.replaceWith.apply(obj, [...span.childNodes]);
}
}
r(d.body); // 게시판 본문 정도로 수정해서 쓰면 좋을 것 같네요.
})(document);주소줄에 붙여넣기용.
모바일 브라우저에서 아무거나 북마크하고 수정하기로 URL 을 이것으로 붙여넣기 하면 웹페이지에서 동작합니다.