Change FPS Display For Bonk.io

Change FPS display on Alt+F press

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

  1. // ==UserScript==
  2. // @name Change FPS Display For Bonk.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Change FPS display on Alt+F press
  6. // @author You
  7. // @match https://bonk.io
  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 specified styles
  18. const fpsDiv = document.querySelector('div[style="position: absolute; width: 50px; height: 20px; color: rgb(187, 187, 187); top: 36px; left: 5px; font-family: futurept_b1; display: block;"]');
  19.  
  20. // Check if the div exists before changing its content
  21. if (fpsDiv) {
  22. fpsDiv.textContent = '540 FPS';
  23. }
  24. }
  25. });
  26. })();