Perplexity.ai: Remove login requirement

Remove login requirement on Perplexity.ai. This includes all annoying overlays, cookie banner and Login features.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name             Perplexity.ai: Remove login requirement
// @name:de          Perplexity.ai: Login-Bedingung entfernen
// @name:en          Perplexity.ai: Remove login requirement
// @author           Maingron
// @namespace        https://maingron.com/
// @homepage         https://maingron.com/
// @supportURL       https://github.com/Maingron/random-stuff/issues
// @source           https://github.com/Maingron/random-stuff/blob/main/004%20Browser%20Scripts/Userscripts/Perplexity.ai%20-%20Remove%20login%20requirement.user.js
// @version          2026.05.4
// @description      Remove login requirement on Perplexity.ai. This includes all annoying overlays, cookie banner and Login features.
// @description:de   Login Bedingung auf Perpexity.ai entfernen. Dies entfernt alle nervigen Overlays, Cookie Banner und Login Features.
// @description:en   Remove login requirement on Perplexity.ai. This includes all annoying overlays, cookie banner and Login features.
// @icon             https://www.perplexity.ai/favicon.ico
// @icon             https://www.perplexity.ai/favicon.svg
// @copyright        2026 Maingron
// @created          2026-05-07
// @modified         2026-05-26
// @license          MIT
// @match            http*://www.perplexity.ai/*
// @match            http*://perplexity.ai/*
// @grant            GM_addStyle
// @tag              perplexity
// @tag              perplexity.ai
// @tag              Pop-Up
// OpenUserJS:       https://openuserjs.org/scripts/Maingron/Perplexity.ai_Remove_login_requirement
// Greasy Fork:      https://greasyfork.org/de/scripts/577012-perplexity-ai-remove-login-requirement
// ==/UserScript==




(function() {
	'use strict';
	console.log("[UserScript][Maingron][Perplexity.ai: Remove login requirement] Removing overlays and writing CSS Code to page");

	// Allow scrolling - Perplexity disables scrolling by preventDefault(e). We intercept and prevent preventDefault if wheel or scroll
	const originalPreventDefault = Event.prototype.preventDefault;
	Event.prototype.preventDefault = function () {
		if (this.type == "wheel" || this.type == "scroll") { } else {
			return originalPreventDefault.call(this);
		}
	};


	const elementsSelectors = [
		"html[lang][dir] body script#google-identity-services-script",
		"html[lang][dir] body #credential_picker_container iframe",
		"html[lang][dir] body #cookie-consent",
		"html[lang][dir] body div[data-type='portal']"
	];

	GM_addStyle(`
		${elementsSelectors.join(",")} {
			display: none !important;
			visibility: hidden !important;
			opacity: 0 !important;
			pointer-events: none !important;
			user-select: none !important;
		}
	`);

	window.addEventListener("load", function () {
		window.setTimeout(function () {
			document.querySelectorAll(elementsSelectors).forEach((item) => {
				item.remove();
			});
		}, 4400 + Math.random() * 2400); // Timeout value is slightly randomized to make it seem more organic
	});
})();