// ==UserScript== // @name chatgpt全屏样式 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 尝试在每次页面加载时更改特定元素的样式 // @author bruceWang // @match https://chat.openai.com/* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; function modifyStyle() { var targetElements = document.querySelectorAll('.flex.flex-1.gap-4.text-base.mx-auto'); if (targetElements) { // 修改样式 targetElements.forEach(item =>{ item.style.maxWidth = 'none'; }) } else { console.log('没找到'); } } var observer = new MutationObserver(function(mutations) { if(mutations.length > 0){ modifyStyle(); } }); observer.observe(document.body, { childList: true, subtree: true }); })();