Auto 2K Resolution

Try to set resolution to 2K on supported devices

  1. // ==UserScript==
  2. // @name Auto 2K Resolution
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Try to set resolution to 2K on supported devices
  6. // @author Tae Parlay
  7. // @license MIT
  8. // @match *://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to set resolution using CSS
  16. function setResolution() {
  17. var style = document.createElement('style');
  18. document.head.appendChild(style);
  19. style.sheet.insertRule('@media (min-width: 2560px) { body { transform: scale(1); } }');
  20. }
  21.  
  22. // Run the script after DOM is fully parsed
  23. document.addEventListener('DOMContentLoaded', setResolution, false);
  24. })();