问答 查看内容
返回列表

内嵌页面导出卡片,文案会提示请前往导出中心,点击导出中心就会跳转出去,怎么隐藏

42 1
发表于 前天 15:57 | 查看全部 阅读模式
内嵌页面导出卡片,文案会提示请前往导出中心,点击导出中心就会跳转出去,怎么隐藏

截图202609031557413955.png

评论1

观小豪楼主Lv.1 发表于 前天 15:58 | 查看全部
关于这个问题,可以字啊“管理中心-开放平台-插件管理”新建插件处理:


插件代码

(() => {
  const pluginName = 'hide-export-center-notice'

  const apply = () => {
    const links = document.querySelectorAll('a[href*="/offline-tasks"]')

    links.forEach(link => {
      if (!/导出中心|Export Center/i.test(link.textContent || '')) return
      if (link.dataset.pluginHidden === 'true') return

      // 隐藏“导出中心”链接
      link.style.display = 'none'
      link.dataset.pluginHidden = 'true'

      // 删除链接前面的“请前往”
      let node = link.previousSibling
      while (node && node.nodeType !== Node.TEXT_NODE) {
        node = node.previousSibling
      }

      if (node && node.nodeType === Node.TEXT_NODE) {
        node.textContent = node.textContent
          .replace(/[,,]?\s*请前往\s*$/, '')
      }
    })
  }

  const start = () => {
    apply()

    const observer = new MutationObserver(apply)
    observer.observe(document.body, {
      childList: true,
      subtree: true,
      characterData: true,
    })

    window.addEventListener('hashchange', apply)
    window.addEventListener('popstate', apply)
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', start, { once: true })
  } else {
    start()
  }
})()

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

微信服务号
联系我们
电话:400-880-0750
邮箱:hello@guandata.com
Copyright © 2001-2026 观远社区 版权所有 All Rights Reserved. 浙 ICP 备15006424号-3
去回复 去发帖 返回顶部
快速回复 返回顶部 返回列表