Skip to content

Commit 40f193b

Browse files
committed
Added hide Perplexity notice on GitLab + early return if not on ChatGPT/Poe ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-widescreen]
1 parent 79e6ef7 commit 40f193b

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

chatgpt/chatgpt-widescreen/chatgpt-widescreen-mode.user.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
// @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-poe.com!
236236
// @author Adam Lui
237237
// @namespace https://github.com/adamlui
238-
// @version 2025.9.17.1
238+
// @version 2025.9.19
239239
// @license MIT
240240
// @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e
241241
// @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e
@@ -250,6 +250,7 @@
250250
// @compatible qq
251251
// @match *://chatgpt.com/*
252252
// @match *://github.com/*
253+
// @match *://gitlab.com/*
253254
// @match *://poe.com/*
254255
// @connect cdn.jsdelivr.net
255256
// @connect gm.chatgptwidescreen.com
@@ -291,11 +292,18 @@
291292

292293
(async () => {
293294

294-
// Hide Perplexity notice on GitHub if found
295-
if (location.pathname.includes('chatgpt-widescreen')) {
296-
const perplexityAlert = [...document.querySelectorAll('.markdown-alert')]
297-
.find(alert => alert.textContent.includes('Perplexity'))
298-
if (perplexityAlert) perplexityAlert.style.display = 'none'
295+
// Hide Perplexity notice on GH/GL if found
296+
if (location.hostname.includes('git')) {
297+
if (location.pathname.includes('chatgpt-widescreen')) {
298+
const alertObserver = new MutationObserver(() => {
299+
const alert = [...document.querySelectorAll('.markdown-alert')]
300+
.find(alert => alert.textContent.includes('Perplexity'))
301+
if (alert) { alert.style.display = 'none' ; alertObserver.disconnect() }
302+
})
303+
alertObserver.observe(document.body, { childList: true, subtree: true })
304+
setTimeout(() => alertObserver.disconnect(), 5000) // don't observer forever
305+
}
306+
return
299307
}
300308

301309
// Init DATA

0 commit comments

Comments
 (0)