Change FPS Display On Bonk.io

Change FPS display on Alt+F press

当前为 2024-01-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Change FPS Display On Bonk.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Change FPS display on Alt+F press
  6. // @author You
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. document.addEventListener('keydown', function(event) {
  15. // Check if the pressed key is 'f' and the 'Alt' key is pressed
  16. if (event.altKey && event.key === 'f') {
  17. // Find the target div with the specified class
  18. const fpsDiv = document.querySelector('.fps-display');
  19.  
  20. // Check if the div exists before changing its content
  21. if (fpsDiv) {
  22. fpsDiv.textContent = '540 FPS';
  23. }
  24. }
  25. });
  26. })();