全球主机交流论坛

标题: (搬运)免费无限制使用magai.co,支持gpt-4o等各大模型 [打印本页]

作者: 文心小助手    时间: 2024-7-23 20:02
提示: 作者被禁止或删除 内容自动屏蔽
作者: 卡尔    时间: 2024-7-23 20:04
能不能生成图片
作者: 文心小助手    时间: 2024-7-23 20:04
提示: 作者被禁止或删除 内容自动屏蔽
作者: oneLN    时间: 2024-7-23 20:09
本帖最后由 oneLN 于 2024-7-23 20:26 编辑

哎呀呀。搞好了。但是呢。不能生图。

作者: oneLN    时间: 2024-7-23 20:29
  1. // ==UserScript==
  2. // [url=home.php?mod=space&uid=5839]@name[/url]         New Userscript
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2024-07-23
  5. // @description  移除Magai.co上的模糊效果,隐藏特定元素,并启用文本输入
  6. // @author       Mahjongmaster88
  7. // @match        https://app.magai.co/*
  8. // @grant        none
  9. // ==/UserScript==

  10. (function() {
  11.     'use strict';

  12.     function removeElements() {
  13.         const selectors = [
  14.             '.column.flex.bubble-r-container.baTwaZp1.Group.bubble-element',
  15.             '.baTydaY.greyout',
  16.             '.baTwaQaG.greyout',
  17.             '.column.flex.bubble-r-container.baTwaQaG.CustomElement.bubble-element > .column.flex.bubble-r-container.baTwcaY.CustomElement.bubble-element',
  18.             '.column.flex.bubble-r-container.baTydaY.CustomElement.bubble-element > .column.flex.bubble-r-container.baTwcaY.CustomElement.bubble-element',
  19.             '.column.flex.bubble-r-container.baTydaY.CustomElement.bubble-element',
  20.             '.column.flex.bubble-r-container.baTwaQaG.CustomElement.bubble-element'
  21.         ];

  22.         selectors.forEach(selector => {
  23.             const elements = document.querySelectorAll(selector);
  24.             elements.forEach(element => {
  25.                 element.style.display = 'none';
  26.             });
  27.         });
  28.     }

  29.     // 移除模糊效果相关代码
  30.     const observer = new MutationObserver(mutations => {
  31.         mutations.forEach(mutation => {
  32.             if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
  33.                 const element = mutation.target;
  34.                 if (element.style.filter.includes('blur')) {
  35.                     console.log('移除模糊效果:', element);
  36.                     element.style.filter = 'none';
  37.                 }
  38.             }
  39.         });
  40.     });

  41.     const removeBlurEffect = () => {
  42.         document.querySelectorAll('*').forEach(element => {
  43.             const style = window.getComputedStyle(element);
  44.             if (style.filter.includes('blur')) {
  45.                 element.style.filter = 'none';
  46.             }

  47.             observer.observe(element, { attributes: true });
  48.         });

  49.         console.log('MutationObserver已启动。');
  50.     };

  51.     removeBlurEffect();

  52.     const bodyObserver = new MutationObserver(mutations => {
  53.         mutations.forEach(mutation => {
  54.             if (mutation.type === 'childList') {
  55.                 mutation.addedNodes.forEach(node => {
  56.                     if (node.nodeType === 1) { // ELEMENT_NODE
  57.                         const style = window.getComputedStyle(node);
  58.                         if (style.filter.includes('blur')) {
  59.                             node.style.filter = 'none';
  60.                         }

  61.                         observer.observe(node, { attributes: true });
  62.                     }
  63.                 });
  64.             }
  65.         });

  66.         // 每当添加新元素时执行removeElements函数
  67.         removeElements();

  68.         // 每当添加新元素时执行enableTextInput函数
  69.         enableTextInput();
  70.     });

  71.     bodyObserver.observe(document.body, { childList: true, subtree: true });

  72.     // 启用文本输入功能
  73.     function enableTextInput() {
  74.         const textarea = document.querySelector('textarea#prompt');
  75.         if (textarea && textarea.disabled) {
  76.             textarea.disabled = false;
  77.             console.log('文本输入已启用。');
  78.         }
  79.     }

  80.     // 初始执行
  81.     removeElements();
  82.     enableTextInput();
  83. })();
复制代码




上面那个前三排报错。我这直接用自带的替换了名字之类的




欢迎光临 全球主机交流论坛 (https://hostloc.onozo.cc/) Powered by Discuz! X3.4