Giter Site home page Giter Site logo

block-shortcuts's Introduction

Block Shortcuts

Browser extension to disallow websites from registering global keyboard shortcuts.

EXPERIMENTAL!

Use case

This extension is for you if you don't want websites to register global keyboard shortcuts in your browser window. It does so by intercepting the addEventListener function on the Window and Document classes, as well as intercepting the listener callback function itself (when registered via Window or Document).

Every time a key event happens in your browser window, the interceptor checks if the associated key event has a modifier key enabled (Ctrl, Shift, Alt, Meta) and blocks the execution of the original listener callback function.

Built-in browser shortcuts (like Ctrl+A to highlight all text) are NOT affected by this interceptor and should still function as intended. Event listeners added to input fields are not affected as they don't directly relate to Window or Document. The input field must have focus anyway for the key event to work. This extension only focuses on global shortcuts for now to prevent running code when no element seems to have focus.

block-shortcuts's People

Contributors

magiruuvelvet avatar

Watchers

 avatar

block-shortcuts's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.