Bionic reading — bold word starts
Bolds the first letters of every word in the article, guiding the eye and speeding up reading.
Code to copy
(function () {
var article = document.querySelector('article, .post, .entry-content, main');
if (!article) return;
var walker = document.createTreeWalker(article, NodeFilter.SHOW_TEXT);
var nodes = [];
while (walker.nextNode()) nodes.push(walker.currentNode);
nodes.forEach(function (node) {
if (!node.nodeValue || !node.nodeValue.trim()) return;
if (node.parentNode && /SCRIPT|STYLE|CODE|PRE/.test(node.parentNode.nodeName)) return;
var frag = document.createDocumentFragment();
node.nodeValue.split(/(\s+)/).forEach(function (part) {
if (!part.trim()) { frag.appendChild(document.createTextNode(part)); return; }
var cut = Math.max(1, Math.ceil(part.length * 0.4));
var b = document.createElement('b');
b.textContent = part.slice(0, cut);
frag.appendChild(b);
frag.appendChild(document.createTextNode(part.slice(cut)));
});
node.parentNode.replaceChild(frag, node);
});
})();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.