Enable Spell Check on OpenAI Playground

Enable spell check for the editor on OpenAI Playground website.

  1. // ==UserScript==
  2. // @name Enable Spell Check on OpenAI Playground
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Enable spell check for the editor on OpenAI Playground website.
  6. // @author ChatGPT
  7. // @match https://platform.openai.com/playground*
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var observer = new MutationObserver(function(mutations) {
  15. mutations.forEach(function(mutation) {
  16. var elements = mutation.target.querySelectorAll('.pg-editor [spellcheck="false"]');
  17. for (var i = 0; i < elements.length; i++) {
  18. elements[i].setAttribute('spellcheck', 'true');
  19. }
  20. });
  21. });
  22.  
  23. observer.observe(document.body, {
  24. childList: true,
  25. subtree: true
  26. });
  27. })();