Bing Copilot Chat Width Wizard (style)

Designed to optimize the width of the chat window, you can enjoy the best chat experience at any screen size. This plugin provides a more intuitive and comfortable chat interface by automatically adjusting and customizing element widths.|界面优化

  1. // ==UserScript==
  2. // @name Bing Copilot Chat Width Wizard (style)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  5. // @description Designed to optimize the width of the chat window, you can enjoy the best chat experience at any screen size. This plugin provides a more intuitive and comfortable chat interface by automatically adjusting and customizing element widths.|界面优化
  6. // @author Bela Proinsias
  7. // @match https://copilot.microsoft.com/chats/*
  8. // @match https://copilot.microsoft.com/*
  9. // @icon https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://microsoft.co&size=64
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Function to adjust the width of elements with specific classes
  17. function adjustWidth() {
  18. const windowWidth = window.innerWidth;
  19. const adjustedWidth = windowWidth * 0.85; // if you wanna change the width, eg. 0.8, 0.9, 0.95, etc.
  20. const elements = document.querySelectorAll('[data-content="conversation"]');
  21. elements.forEach(element => {
  22. element.style.maxWidth = adjustedWidth + 'px';
  23. element.style.width = adjustedWidth + 'px';
  24. });
  25. }
  26.  
  27. // Function to observe DOM changes
  28. function observeDOMChanges() {
  29. const observer = new MutationObserver(adjustWidth);
  30. const config = { childList: true, subtree: true };
  31.  
  32. // Start observing the document body for changes
  33. observer.observe(document.body, config);
  34. }
  35.  
  36. // Adjust width on window load and start observing DOM changes
  37. window.addEventListener('load', () => {
  38. adjustWidth();
  39. observeDOMChanges();
  40. });
  41.  
  42. // Adjust width on window resize
  43. window.addEventListener('resize', adjustWidth);
  44. })();

QingJ © 2025

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