Open Settings with CTRL + Q

Opens settings when CTRL + Q is pressed

  1. // ==UserScript==
  2. // @name Open Settings with CTRL + Q
  3. // @namespace random
  4. // @license You may share the code, edit it and publish.
  5. // @version 0.1
  6. // @description Opens settings when CTRL + Q is pressed
  7. // @match *://starblast.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to open settings
  15. function openSettings() {
  16. const settingsButton = document.querySelector('.sbg.sbg-gears');
  17. if (settingsButton) {
  18. settingsButton.click();
  19. } else {
  20. console.log('Settings button not found!');
  21. }
  22. }
  23.  
  24. // Listen for keydown events
  25. window.addEventListener('keydown', (event) => {
  26. // Check if CTRL + Q is pressed
  27. if (event.key === 'q' && event.ctrlKey) {
  28. openSettings();
  29. }
  30. });
  31. })();