Focus-on-table toggle
Adds a floating button that hides navigation and header in one click, leaving just the data table.
Code to copy
(function () {
var btn = document.createElement('button');
btn.textContent = 'Focus table';
btn.style.cssText = 'position:fixed;right:14px;bottom:14px;z-index:99999;' +
'padding:8px 12px;background:#1a73e8;color:#fff;border:0;border-radius:6px;' +
'font:13px sans-serif;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.3);';
var on = false;
btn.addEventListener('click', function () {
on = !on;
var nav = document.querySelector('[role="navigation"]');
var banner = document.querySelector('[role="banner"]');
[nav, banner].forEach(function (el) {
if (el) el.style.display = on ? 'none' : '';
});
btn.textContent = on ? 'Show all' : 'Focus table';
});
document.body.appendChild(btn);
})();
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.