Button Display Notification

Will send a windows notification when you images are finished generating

当前为 2023-09-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Button Display Notification
  3. // @namespace Turkeychopio
  4. // @match http://127.0.0.1:7860/
  5. // @grant GM_notification
  6. // @version 1.0
  7. // @description Will send a windows notification when you images are finished generating
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. let currentStyle = '';
  14. let previousStyle = '';
  15.  
  16. // Check for button with specific class and style
  17. setInterval(function() {
  18. const button = document.querySelector('.lg.secondary.gradio-button.generate-box-skip.svelte-1ipelgc');
  19. currentStyle = window.getComputedStyle(button).display;
  20. console.log("currentStyle = " + currentStyle);
  21. console.log("previous style = " + previousStyle);
  22.  
  23. if (previousStyle === 'block' && currentStyle === 'none') {
  24. GM_notification ( {title: 'A111', text: 'Image Generation Complete', image: 'chrome://favicon/http://127.0.0.1:7860/', timeout: 1000} );
  25. }
  26. previousStyle = currentStyle;
  27. }, 1000); // Check every 1 second (adjust as needed)
  28. })();

QingJ © 2025

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