Display Coze Bot With FullScreen

将Coze对话框全屏

  1. // ==UserScript==
  2. // @name Display Coze Bot With FullScreen
  3. // @version 2024-02-24
  4. // @description 将Coze对话框全屏
  5. // @author CyanFalse
  6. // @match https://www.coze.com/*
  7. // @icon https://www.google.com/s2/favicons?sz=64&domain=coze.com
  8. // @grant none
  9. // @namespace https://gf.qytechs.cn/users/370662
  10. // ==/UserScript==
  11. (async function () {
  12. 'use strict';
  13. await new Promise((resolve) => {
  14. const interval = setInterval(() => {
  15. if(!location.pathname.match(/\/space\/\d+\/bot\/\d+/g)) return;
  16. if (Object.values(document.querySelectorAll('span')).filter((span) => span.innerText === 'Publish')[0]) {
  17. clearInterval(interval)
  18. resolve()
  19. }
  20. }, 1000)
  21. })
  22. const PublishButtonSpan = Object.values(document.querySelectorAll('span')).filter((span) => span.innerText === 'Publish')[0]
  23. const PublishButton = PublishButtonSpan.parentElement
  24. const HideButtonSpan = PublishButtonSpan.cloneNode(true)
  25. const HideButton = PublishButton.cloneNode(true)
  26. HideButtonSpan.innerText = 'Hide'
  27. HideButton.innerHTML = ''
  28. HideButton.appendChild(HideButtonSpan)
  29. PublishButton.parentElement.appendChild(HideButton)
  30. const container = document.getElementsByClassName('sidesheet-container')[0]
  31. const feedback = document.querySelectorAll('[id^="feelgood_root"]')[0]
  32. const hide = () => {
  33. container.children[0].style.display = 'none'
  34. container.children[1].style.display = 'none'
  35. container.style.display = 'unset'
  36. feedback.style.display = 'none'
  37. HideButton.removeEventListener('click', hide)
  38. HideButton.addEventListener('click', show)
  39. }
  40. const show = () => {
  41. container.children[0].style.display = 'unset'
  42. container.children[1].style.display = 'unset'
  43. container.style.display = 'grid'
  44. feedback.style.display = 'unset'
  45. HideButton.removeEventListener('click', show)
  46. HideButton.addEventListener('click', hide)
  47. }
  48. HideButton.addEventListener('click', hide)
  49. HideButton.click()
  50. })();

QingJ © 2025

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