iGPU Activator

解决Intel核显导致的浏览器卡顿!

  1. // ==UserScript==
  2. // @name iGPU Activator
  3. // @name:zh-CN iGPU Activator
  4. // @version 0.1
  5. // @description Fix annoying lag for integrated iGPU!
  6. // @description:zh-cn 解决Intel核显导致的浏览器卡顿!
  7. // @author MapleRecall
  8. // @icon https://ark.intel.com/etc.clientlibs/settings/wcm/designs/intel/default/resources/favicon-32x32.png
  9. // @match *://*/*
  10. // @grant none
  11. // @noframes
  12. // @namespace https://gf.qytechs.cn/users/53
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const canvas = document.createElement("canvas");
  19. canvas.width = 1;
  20. canvas.height = 1;
  21. canvas.style.position = "fixed";
  22. canvas.style.top = 0;
  23. canvas.style.left = 0;
  24. canvas.style.zIndex = 100000000;
  25. canvas.style.isolation = "isolate";
  26. canvas.style.pointerEvents = "none";
  27. document.body.append(canvas);
  28.  
  29. const gl = canvas.getContext("webgl");
  30. function draw() {
  31. gl.clearColor(0, 0, 0, 0);
  32. gl.clear(gl.COLOR_BUFFER_BIT);
  33. }
  34.  
  35. let drawTimer;
  36. let idleTimer;
  37. function stopDraw() {
  38. canvas.style.display = "none";
  39. clearTimeout(idleTimer);
  40. clearInterval(drawTimer);
  41. }
  42.  
  43. function startDraw() {
  44. stopDraw();
  45. if (document.hidden || document.fullscreenElement) return;
  46.  
  47. canvas.style.display = "";
  48. drawTimer = setInterval(draw, 200);
  49. }
  50.  
  51. document.addEventListener("visibilitychange", startDraw);
  52. document.addEventListener("fullscreenchange", startDraw);
  53. document.addEventListener("mouseenter", startDraw);
  54. document.addEventListener("mouseleave", () => { idleTimer = setTimeout(stopDraw, 60000) });
  55.  
  56. startDraw();
  57. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址