Set AI Studio Content Filters to None With One Click

see name

当前为 2024-07-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @license it made me include this idk
  3. // @name Set AI Studio Content Filters to None With One Click
  4. // @description see name
  5. // @namespace http://tampermonkey.net/
  6. // @version 0.1
  7. // @match https://aistudio.google.com/app/prompts*
  8. // @grant none
  9. // @author HORSELOCKSPACEPIRATE/rayzorium
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function setFiltersToLowest() {
  16. const safetyDialog = document.querySelector('.run-safety-settings');
  17. if (safetyDialog) {
  18. const sliders = safetyDialog.querySelectorAll('mat-slider input[type="range"]');
  19. sliders.forEach(slider => {
  20. slider.value = slider.min;
  21. slider.dispatchEvent(new Event('input', { bubbles: true }));
  22. });
  23. }
  24. }
  25.  
  26. // Run when the safety settings dialog opens
  27. const observer = new MutationObserver(mutations => {
  28. for (let mutation of mutations) {
  29. if (mutation.addedNodes.length) {
  30. if (document.querySelector('.run-safety-settings')) {
  31. setFiltersToLowest();
  32. break;
  33. }
  34. }
  35. }
  36. });
  37.  
  38. observer.observe(document.body, { childList: true, subtree: true });
  39. })();