Google Slides Custom Plus Button

Add a custom button to Google Slides toolbar for additional features

  1. // ==UserScript==
  2. // @name Google Slides Custom Plus Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Add a custom button to Google Slides toolbar for additional features
  6. // @author Your Name
  7. // @match https://docs.google.com/presentation/d/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to create and add a custom button to the toolbar
  16. const addCustomButton = () => {
  17. const toolbar = document.querySelector('[aria-label="Google Slides"] .punch-viewer-toolbar');
  18. if (toolbar) {
  19. // Create a new button
  20. const button = document.createElement('button');
  21. button.innerText = '+';
  22. button.style.marginLeft = '10px';
  23. button.style.fontSize = '20px';
  24. button.style.backgroundColor = '#f1f1f1';
  25. button.style.border = 'none';
  26. button.style.padding = '5px 10px';
  27. button.style.cursor = 'pointer';
  28.  
  29. // Action for button click
  30. button.onclick = () => {
  31. // Example action: show an alert with options
  32. const action = prompt('Choose an action:\n1. Morph Transition\n2. Zoom\n3. Presenter Coach\n4. Animation\n5. Charts\n6. Slide Maker\n7. 3D Models\n8. Drawing\n9. Font Import\n10. Images');
  33. switch(action) {
  34. case '1':
  35. alert('Morph Transition feature (not implemented)');
  36. break;
  37. case '2':
  38. alert('Zoom feature (not implemented)');
  39. break;
  40. case '3':
  41. alert('Presenter Coach feature (not implemented)');
  42. break;
  43. case '4':
  44. alert('Animation feature (not implemented)');
  45. break;
  46. case '5':
  47. alert('Charts feature (not implemented)');
  48. break;
  49. case '6':
  50. alert('Slide Maker feature (not implemented)');
  51. break;
  52. case '7':
  53. alert('3D Models feature (not implemented)');
  54. break;
  55. case '8':
  56. alert('Drawing feature (not implemented)');
  57. break;
  58. case '9':
  59. alert('Font Import feature (not implemented)');
  60. break;
  61. case '10':
  62. alert('Images feature (not implemented)');
  63. break;
  64. default:
  65. alert('Invalid option');
  66. }
  67. };
  68.  
  69. // Add button to toolbar
  70. toolbar.appendChild(button);
  71. } else {
  72. // Retry if toolbar not found
  73. setTimeout(addCustomButton, 1000);
  74. }
  75. };
  76.  
  77. // Run the function to add the button
  78. addCustomButton();
  79. })();

QingJ © 2025

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