Outlook: slash key jumps to search
Pressing the slash key automatically jumps the cursor into the mail search box.
Code to copy
// Press the slash key to jump straight into the search box
document.addEventListener('keydown', function (e) {
if (e.key !== '/' || e.ctrlKey || e.metaKey || e.altKey) { return; }
const tag = (e.target.tagName || '').toLowerCase();
if (tag === 'input' || tag === 'textarea' || e.target.isContentEditable) { return; }
const box = document.querySelector('input[aria-label*="Search"], input[aria-label*="Szukaj"], input[type="search"]');
if (box) {
e.preventDefault();
box.focus();
}
});
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.