Google Docs/Slides Always Visible Turn In Button

Keeps the "Turn in" button always visible on Google Docs and Slides through Google Classroom.

目前为 2024-11-10 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Google Docs/Slides Always Visible Turn In Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Keeps the "Turn in" button always visible on Google Docs and Slides through Google Classroom.
  6. // @author You
  7. // @match *://docs.google.com/*
  8. // @match *://slides.google.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function makeTurnInButtonVisible() {
  16. // Check for the button using a query selector
  17. let turnInButton = document.querySelector('[aria-label="Turn in"]');
  18.  
  19. if (turnInButton) {
  20. // Ensure the button is always visible
  21. turnInButton.style.display = "inline-block";
  22. turnInButton.style.visibility = "visible";
  23. turnInButton.style.position = "fixed";
  24. turnInButton.style.top = "10px";
  25. turnInButton.style.right = "10px";
  26. turnInButton.style.zIndex = "1000";
  27. }
  28. }
  29.  
  30. // Run the function initially and set an interval to keep checking in case of DOM updates
  31. makeTurnInButtonVisible();
  32. setInterval(makeTurnInButtonVisible, 2000);
  33. })();