Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save eugrus/e14b8cb66307bd55da1f0f58af8cb0f3 to your computer and use it in GitHub Desktop.

Select an option

Save eugrus/e14b8cb66307bd55da1f0f58af8cb0f3 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Perplexity: Standardmäßig 'Suche' aktivieren
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Wählt automatisch die Option 'Suche' statt 'Computer' in der Perplexity-Oberfläche.
// @author Du
// @match https://www.perplexity.ai/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
function selectSearchOption() {
// Sucht nach Elementen/Buttons, die den Text "Suche" oder "Search" enthalten
const buttons = Array.from(document.querySelectorAll('button, div[role="button"]'));
const searchButton = buttons.find(el => {
const text = el.textContent.trim().toLowerCase();
return text === 'suche' || text === 'search';
});
if (searchButton) {
// Prüft, ob der Button nicht bereits ausgewählt ist (z. B. via aria-checked oder Klasse)
const isSelected = searchButton.getAttribute('aria-checked') === 'true' ||
searchButton.classList.contains('active');
if (!isSelected) {
searchButton.click();
}
}
}
// Erster Versuch nach dem Laden der Seite
setTimeout(selectSearchOption, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment