Remove Comet promotion and thread warning banners
当前为
// ==UserScript==
// @name Perplexity - remove Comet + "Thread is getting long" banners
// @namespace your.namespace
// @match https://www.perplexity.ai/*
// @grant none
// @version 1.0
// @license MIT
// @description Remove Comet promotion and thread warning banners
// ==/UserScript==
(function() {
'use strict';
function removeBanners() {
const selectors = [
// Comet banner - look for the rounded-xl shadow-xl container
'div.rounded-xl.shadow-xl.ring-1.border-subtlest',
// Thread warning - look for the role="alert" container
'div[role="alert"].bg-subtler.rounded-t-lg'
];
selectors.forEach(selector => {
const elements = document.querySelectorAll(selector);
elements.forEach(el => {
const text = el.textContent;
if (text.includes('Comet can do this faster') ||
text.includes('Thread is getting long')) {
el.remove();
}
});
});
}
// Run immediately on page load
removeBanners();
// Watch for new elements being added
const observer = new MutationObserver((mutations) => {
removeBanners();
});
// Start observing the document body for changes
observer.observe(document.body, {
childList: true,
subtree: true
});
})();