IMDb: "b" keyboard shortcut to go back
Adds a "b" keyboard shortcut that instantly goes back to the previous page outside text fields.
Code to copy
// Press "b" to go back to the previous page quickly
document.addEventListener('keydown', (e) => {
const tag = (e.target.tagName || '').toLowerCase();
if (tag === 'input' || tag === 'textarea' || e.target.isContentEditable) { return; }
if (e.key === 'b' && !e.ctrlKey && !e.metaKey && !e.altKey) {
history.back();
}
});
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.