Always Allow API Actions

Auto-clicks the 'Confirm' or 'Always Allow' buttons when prompted for an API call

  1. // ==UserScript==
  2. // @name Always Allow API Actions
  3. // @namespace ViolentMonkey scripts
  4. // @version 0.1
  5. // @description Auto-clicks the 'Confirm' or 'Always Allow' buttons when prompted for an API call
  6. // @author bmpq
  7. // @license MIT
  8. // @match https://chatgpt.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function clickButtons() {
  16. // Click the Confirm button
  17. const confirmButtons = document.querySelectorAll('.btn.relative.btn-primary.btn-small');
  18. confirmButtons.forEach((button) => {
  19. const buttonText = button.querySelector('div').textContent.trim();
  20. if (buttonText === 'Confirm') {
  21. button.click();
  22. console.log('Confirm button clicked!');
  23. }
  24. });
  25.  
  26. // Click the Always Allow button
  27. const allowButtons = document.querySelectorAll('.btn.relative.btn-secondary.btn-small');
  28. allowButtons.forEach((button) => {
  29. const buttonText = button.querySelector('div').textContent.trim();
  30. if (buttonText === 'Always Allow') {
  31. button.click();
  32. console.log('Always Allow button clicked!');
  33. }
  34. });
  35. }
  36.  
  37. const observer = new MutationObserver(clickButtons);
  38. observer.observe(document.body, { childList: true, subtree: true });
  39. })();

QingJ © 2025

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