您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script allows you to unlock the main answer to Brainly questions in a simple and direct way, without simulating a Pro account. It uses a technique based on simulated anonymous access, bypassing view restrictions and displaying the full answer — no login or incognito tab required.
- // ==UserScript==
- // @name Unlock Brainly Answers
- // @name:pt-BR Desbloquear Respostas Brainly
- // @name:en-US Unlock Brainly Answers
- // @name:es-ES Desbloquear Respostas Brainly
- // @name:pl-PL Odblokuj Odpowiedzi Brainly
- // @name:id-ID Buka Kunci Jawaban Brainly
- // @name:ru-RU Разблокировать ответы Brainly
- // @name:tr-TR Brainly Cevaplarını Aç
- // @name:ro-RO Deblochează Răspunsurile Brainly
- // @name:hi-IN ब्रेनली उत्तरों को अनलॉक करें
- // @name:fil-PH I-unlock ang mga Sagot sa Brainly
- // @namespace DesbloquearRespostasBrainly
- // @version 1.3.1
- // @description This script allows you to unlock the main answer to Brainly questions in a simple and direct way, without simulating a Pro account. It uses a technique based on simulated anonymous access, bypassing view restrictions and displaying the full answer — no login or incognito tab required.
- // @description:pt-BR Este script permite desbloquear a resposta principal das perguntas no Brainly de forma simples e direta, sem simular uma conta Pro. Ele utiliza uma técnica baseada em acesso anônimo simulado, contornando as restrições de visualização e exibindo a resposta completa — sem precisar fazer login ou abrir guia anônima.
- // @description:en This script allows you to unlock the main answer to Brainly questions in a simple and direct way, without simulating a Pro account. It uses a technique based on simulated anonymous access, bypassing view restrictions and displaying the full answer — no login or incognito tab required.
- // @description:es Este script permite desbloquear la respuesta principal de las preguntas en Brainly de forma simple y directa, sin simular una cuenta Pro. Utiliza una técnica basada en acceso anónimo simulado, evitando las restricciones de visualización y mostrando la respuesta completa — sin necesidad de iniciar sesión o abrir una pestaña de incógnito.
- // @description:pl Ten skrypt pozwala odblokować główną odpowiedź na pytania w Brainly w prosty i bezpośredni sposób, bez symulowania konta Pro. Wykorzystuje technikę opartą na symulowanym anonimowym dostępie, omijając ograniczenia wyświetlania i pokazując pełną odpowiedź — bez konieczności logowania się lub otwierania karty incognito.
- // @description:id Skrip ini memungkinkan Anda membuka kunci jawaban utama untuk pertanyaan Brainly dengan cara yang sederhana dan langsung, tanpa mensimulasikan akun Pro. Ini menggunakan teknik berdasarkan akses anonim yang disimulasikan, melewati batasan tampilan dan menampilkan jawaban lengkap — tanpa login atau tab penyamaran diperlukan.
- // @description:ru Этот скрипт позволяет разблокировать основной ответ на вопросы Brainly простым и прямым способом, без имитации учетной записи Pro. Он использует технику, основанную на имитации анонимного доступа, обходя ограничения просмотра и отображая полный ответ — без необходимости входа в систему или открытия вкладки инкогнито.
- // @description:tr Bu komut dosyası, bir Pro hesabını simüle etmeden, basit ve doğrudan bir şekilde Brainly sorularına verilen ana cevabın kilidini açmanıza olanak tanır. Görüntüleme kısıtlamalarını aşarak ve tam cevabı görüntüleyerek simüle edilmiş anonim erişime dayalı bir teknik kullanır — giriş yapmanız veya gizli sekme açmanız gerekmez.
- // @description:ro Acest script vă permite să deblocați răspunsul principal la întrebările Brainly într-un mod simplu și direct, fără a simula un cont Pro. Folosește o tehnică bazată pe acces anonim simulat, ocolind restricțiile de vizualizare și afișând răspunsul complet — fără a fi necesară autentificarea sau deschiderea unei file incognito.
- // @homepage https://ko-fi.com/l4pisd4silv4#
- // @license MIT
- // @author L4pisD4Silv4
- // @match *://*/*
- // @match *://*.brainly.com.br/*
- // @match *://*.brainly.in/*
- // @match *://*.brainly.ph/*
- // @match *://*.brainly.pl/*
- // @match *://*.brainly.co.id/*
- // @match *://*.brainly.lat/*
- // @match *://*.znanija.com/*
- // @match *://*.eodev.com/*
- // @match *://*.brainly.ro/*
- // @match *://*.brainly.com/*
- // @icon https://img.icons8.com/?size=512&id=DBQ34fANpy5j&format=png
- // @grant GM_xmlhttpRequest
- // @grant GM_registerMenuCommand
- // @grant GM_unregisterMenuCommand
- // @grant GM_addStyle
- // @grant GM_getValue
- // @grant GM_setValue
- // @grant GM_info
- // @connect *
- // @run-at document-end
- // ==/UserScript==
- (function() {
- 'use strict';
- const isBrainlySite = () => {
- const hostname = window.location.hostname;
- return hostname.includes('brainly') ||
- hostname.includes('znanija.com') ||
- hostname.includes('eodev.com');
- };
- const languageData = {
- 'pt-BR': {
- name: 'Português (Brasil)',
- domain: 'brainly.com.br',
- menu: {
- search: '🔎 Fazer Pergunta (Shift+Enter)',
- support: '☕ Apoiar o Desenvolvedor',
- reload: '🔁 Recarregar Página',
- language: '🌐 Idioma'
- },
- modal: {
- placeholder: 'Digite sua pergunta ou dúvida aqui...',
- searchBtn: 'Pesquisar',
- supportBtn: '☕ Apoiar o Desenvolvedor',
- footer: 'Use Shift+Enter para abrir a pesquisa rapidamente',
- chars: 'caracteres',
- char: 'caractere',
- },
- notifications: {
- changingLanguage: 'Alterando idioma para:',
- copied: 'Resposta copiada!',
- copyTooltip: 'Copiar resposta'
- }
- },
- 'en-US': {
- name: 'English',
- domain: 'brainly.com',
- menu: {
- search: '🔎 Ask Question (Shift+Enter)',
- support: '☕ Support Developer',
- reload: '🔁 Reload Page',
- language: '🌐 Language'
- },
- modal: {
- placeholder: 'Type your question or doubt here...',
- searchBtn: 'Search',
- supportBtn: '☕ Support Developer',
- footer: 'Use Shift+Enter to quickly open search',
- chars: 'characters',
- char: 'character',
- },
- notifications: {
- changingLanguage: 'Changing language to:',
- copied: 'Answer copied!',
- copyTooltip: 'Copy answer'
- }
- },
- 'es-ES': {
- name: 'Español',
- domain: 'brainly.lat',
- menu: {
- search: '🔎 Hacer Pregunta (Shift+Enter)',
- support: '☕ Apoyar al Desarrollador',
- reload: '🔁 Recargar Página',
- language: '🌐 Idioma'
- },
- modal: {
- placeholder: 'Escribe tu pregunta o duda aquí...',
- searchBtn: 'Buscar',
- supportBtn: '☕ Apoyar al Desarrollador',
- footer: 'Usa Shift+Enter para abrir la búsqueda rápidamente',
- chars: 'caracteres',
- char: 'carácter',
- },
- notifications: {
- changingLanguage: 'Cambiando idioma a:',
- copied: 'Respuesta copiada!',
- copyTooltip: 'Copiar respuesta'
- }
- },
- 'pl-PL': {
- name: 'Polski',
- domain: 'brainly.pl',
- menu: {
- search: '🔎 Zadaj Pytanie (Shift+Enter)',
- support: '☕ Wesprzyj Programistę',
- reload: '🔁 Odśwież Stronę',
- language: '🌐 Język'
- },
- modal: {
- placeholder: 'Wpisz swoje pytanie lub wątpliwość tutaj...',
- searchBtn: 'Szukaj',
- supportBtn: '☕ Wesprzyj Programistę',
- footer: 'Użyj Shift+Enter, aby szybko otworzyć wyszukiwanie',
- chars: 'znaków',
- char: 'znak',
- },
- notifications: {
- changingLanguage: 'Zmiana języka na:',
- copied: 'Odpowiedź skopiowana!',
- copyTooltip: 'Kopiuj odpowiedź'
- }
- },
- 'id-ID': {
- name: 'Bahasa Indonesia',
- domain: 'brainly.co.id',
- menu: {
- search: '🔎 Ajukan Pertanyaan (Shift+Enter)',
- support: '☕ Dukung Pengembang',
- reload: '🔁 Muat Ulang Halaman',
- language: '🌐 Bahasa'
- },
- modal: {
- placeholder: 'Ketik pertanyaan atau keraguan Anda di sini...',
- searchBtn: 'Cari',
- supportBtn: '☕ Dukung Pengembang',
- footer: 'Gunakan Shift+Enter untuk membuka pencarian dengan cepat',
- chars: 'karakter',
- char: 'karakter',
- },
- notifications: {
- changingLanguage: 'Mengubah bahasa ke:',
- copied: 'Jawaban disalin!',
- copyTooltip: 'Salin jawaban'
- }
- },
- 'ru-RU': {
- name: 'Русский',
- domain: 'znanija.com',
- menu: {
- search: '🔎 Задать Вопрос (Shift+Enter)',
- support: '☕ Поддержать Разработчика',
- reload: '🔁 Перезагрузить Страницу',
- language: '🌐 Язык'
- },
- modal: {
- placeholder: 'Введите свой вопрос или сомнение здесь...',
- searchBtn: 'Поиск',
- supportBtn: '☕ Поддержать Разработчика',
- footer: 'Используйте Shift+Enter, чтобы быстро открыть поиск',
- chars: 'символов',
- char: 'символ',
- },
- notifications: {
- changingLanguage: 'Изменение языка на:',
- copied: 'Ответ скопирован!',
- copyTooltip: 'Копировать ответ'
- }
- },
- 'tr-TR': {
- name: 'Türkçe',
- domain: 'eodev.com',
- menu: {
- search: '🔎 Soru Sor (Shift+Enter)',
- support: '☕ Geliştiriciyi Destekle',
- reload: '🔁 Sayfayı Yenile',
- language: '🌐 Dil'
- },
- modal: {
- placeholder: 'Sorunuzu veya şüphenizi buraya yazın...',
- searchBtn: 'Ara',
- supportBtn: '☕ Geliştiriciyi Destekle',
- footer: 'Aramayı hızlıca açmak için Shift+Enter kullanın',
- chars: 'karakter',
- char: 'karakter',
- },
- notifications: {
- changingLanguage: 'Dil değiştiriliyor:',
- copied: 'Cevap kopyalandı!',
- copyTooltip: 'Cevabı kopyala'
- }
- },
- 'ro-RO': {
- name: 'Română',
- domain: 'brainly.ro',
- menu: {
- search: '🔎 Pune o Întrebare (Shift+Enter)',
- support: '☕ Sprijină Dezvoltatorul',
- reload: '🔁 Reîncarcă Pagina',
- language: '🌐 Limbă'
- },
- modal: {
- placeholder: 'Tastează întrebarea sau îndoiala ta aici...',
- searchBtn: 'Caută',
- supportBtn: '☕ Sprijină Dezvoltatorul',
- footer: 'Folosește Shift+Enter pentru a deschide căutarea rapid',
- chars: 'caractere',
- char: 'caracter',
- },
- notifications: {
- changingLanguage: 'Schimbarea limbii în:',
- copied: 'Răspuns copiat!',
- copyTooltip: 'Copiază răspunsul'
- }
- },
- 'hi-IN': {
- name: 'हिंदी (India)',
- domain: 'brainly.in',
- menu: {
- search: '🔎 प्रश्न पूछें (Shift+Enter)',
- support: '☕ डेवलपर का समर्थन करें',
- reload: '🔁 पेज रीलोड करें',
- language: '🌐 भाषा'
- },
- modal: {
- placeholder: 'अपना प्रश्न या संदेह यहां टाइप करें...',
- searchBtn: 'खोजें',
- supportBtn: '☕ डेवलपर का समर्थन करें',
- footer: 'खोज जल्दी खोलने के लिए Shift+Enter का उपयोग करें',
- chars: 'वर्ण',
- char: 'वर्ण',
- },
- notifications: {
- changingLanguage: 'भाषा बदल रहा है:',
- copied: 'उत्तर कॉपी किया गया!',
- copyTooltip: 'उत्तर कॉपी करें'
- }
- },
- 'fil-PH': {
- name: 'Filipino',
- domain: 'brainly.ph',
- menu: {
- search: '🔎 Magtanong (Shift+Enter)',
- support: '☕ Suportahan ang Developer',
- reload: '🔁 I-reload ang Page',
- language: '🌐 Wika'
- },
- modal: {
- placeholder: 'I-type ang iyong katanungan o pag-aalinlangan dito...',
- searchBtn: 'Maghanap',
- supportBtn: '☕ Suportahan ang Developer',
- footer: 'Gamitin ang Shift+Enter para mabilis na buksan ang paghahanap',
- chars: 'mga character',
- char: 'character',
- },
- notifications: {
- changingLanguage: 'Pagpapalit ng wika sa:',
- copied: 'Nakopya ang sagot!',
- copyTooltip: 'Kopyahin ang sagot'
- }
- }
- };
- const detectLanguage = () => {
- const hostname = window.location.hostname;
- if (hostname.includes('brainly.com.br')) return 'pt-BR';
- if (hostname.includes('brainly.lat')) return 'es-ES';
- if (hostname.includes('brainly.pl')) return 'pl-PL';
- if (hostname.includes('brainly.co.id')) return 'id-ID';
- if (hostname.includes('znanija.com')) return 'ru-RU';
- if (hostname.includes('eodev.com')) return 'tr-TR';
- if (hostname.includes('brainly.ro')) return 'ro-RO';
- if (hostname.includes('brainly.in')) return 'hi-IN';
- if (hostname.includes('brainly.ph')) return 'fil-PH';
- return 'en-US';
- };
- const detectBrowserLanguage = () => {
- const browserLang = navigator.language || navigator.userLanguage;
- if (languageData[browserLang]) {
- return browserLang;
- }
- const primaryLang = browserLang.split('-')[0];
- for (const langCode in languageData) {
- if (langCode.startsWith(primaryLang + '-')) {
- return langCode;
- }
- }
- return 'en-US';
- };
- let currentLang = GM_getValue('lang') || detectLanguage() || detectBrowserLanguage();
- if (!languageData[currentLang]) currentLang = 'en-US';
- let menuIDs = { search: null, support: null, reload: null, language: null };
- const registerMenuCommands = () => {
- Object.values(menuIDs).forEach(id => {
- if (id) GM_unregisterMenuCommand(id);
- });
- const texts = languageData[currentLang].menu;
- if (isBrainlySite()) {
- menuIDs.language = GM_registerMenuCommand(texts.language, showLanguageModal);
- menuIDs.search = GM_registerMenuCommand(texts.search, showSearchModal);
- menuIDs.support = GM_registerMenuCommand(texts.support, showSupportModal);
- menuIDs.reload = GM_registerMenuCommand(texts.reload, () => window.location.reload(true));
- } else {
- menuIDs.language = GM_registerMenuCommand(texts.language, showLanguageModal);
- menuIDs.search = GM_registerMenuCommand(texts.search, showSearchModal);
- menuIDs.support = GM_registerMenuCommand(texts.support, showSupportModal);
- }
- };
- const showLanguageModal = () => {
- const modal = document.createElement('div');
- modal.className = 'lang-modal';
- Object.keys(languageData).forEach(lang => {
- const btn = document.createElement('button');
- btn.className = 'lang-option';
- if (lang === currentLang) {
- btn.classList.add('lang-selected');
- }
- btn.textContent = languageData[lang].name;
- btn.onclick = () => {
- updateLanguage(lang);
- modal.remove();
- };
- modal.appendChild(btn);
- });
- GM_addStyle(`
- .lang-modal {
- position: fixed !important;
- top: 50% !important;
- left: 50% !important;
- transform: translate(-50%, -50%) !important;
- width: 300px !important;
- padding: 20px !important;
- background: #1a1a1a !important;
- border: none !important;
- border-radius: 12px !important;
- z-index: 99999 !important;
- box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
- direction: ${currentLang === 'ar-SA' ? 'rtl' : 'ltr'} !important;
- }
- .lang-option {
- margin: 8px 0 !important;
- padding: 12px !important;
- width: 100% !important;
- border: none !important;
- border-radius: 8px !important;
- background: #2d2d2d !important;
- color: #e0e0e0 !important;
- cursor: pointer !important;
- transition: all 0.2s ease !important;
- font-size: 15px !important;
- text-align: center !important;
- }
- .lang-option:hover {
- background: #3a3a3a !important;
- transform: translateY(-2px) !important;
- }
- .lang-selected {
- background: #2d5af6 !important;
- color: white !important;
- font-weight: 500 !important;
- }
- .lang-selected:hover {
- background: #3365ff !important;
- }
- `);
- document.body.appendChild(modal);
- document.addEventListener('click', (e) => {
- if (!modal.contains(e.target)) modal.remove();
- }, { once: true });
- };
- const updateLanguage = (lang) => {
- const currentMessages = languageData[currentLang].notifications;
- currentLang = lang;
- GM_setValue('lang', lang);
- const notification = document.createElement('div');
- notification.textContent = `${currentMessages.changingLanguage} ${languageData[lang].name}`;
- notification.style.cssText = `
- position: fixed;
- bottom: 20px;
- left: 50%;
- transform: translateX(-50%);
- background-color: #2d5af6;
- color: white;
- padding: 10px 20px;
- border-radius: 8px;
- font-size: 14px;
- z-index: 999999;
- box-shadow: 0 3px 10px rgba(0,0,0,0.3);
- transition: opacity 0.3s ease;
- `;
- document.body.appendChild(notification);
- notification.offsetHeight;
- setTimeout(() => {
- window.location.reload();
- }, 1000);
- };
- const showSearchModal = () => {
- const texts = languageData[currentLang].modal;
- const modal = document.createElement('div');
- modal.id = 'brainly-search-modal';
- setStyle(modal, {
- position: 'fixed',
- top: '0',
- left: '0',
- width: '100%',
- height: '100%',
- backgroundColor: 'rgba(0, 0, 0, 0.7)',
- backdropFilter: 'blur(5px)',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- zIndex: '999999',
- opacity: '0',
- transition: 'opacity 0.4s ease-out'
- });
- const container = document.createElement('div');
- setStyle(container, {
- backgroundColor: '#1a1a1a',
- width: '520px',
- maxWidth: '92%',
- borderRadius: '16px',
- boxShadow: '0 10px 30px rgba(0, 0, 0, 0.5)',
- overflow: 'hidden',
- transform: 'translateY(20px) scale(0.95)',
- opacity: '0',
- position: 'relative',
- padding: '40px 24px 24px',
- transition: 'transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s ease'
- });
- const closeBtn = document.createElement('button');
- closeBtn.id = 'brainly-close-btn';
- closeBtn.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="#e0e0e0"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>';
- setStyle(closeBtn, {
- position: 'absolute',
- top: '10px',
- right: '10px',
- background: 'rgba(255, 255, 255, 0.1)',
- border: 'none',
- borderRadius: '50%',
- width: '32px',
- height: '32px',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- cursor: 'pointer',
- padding: '0',
- transition: 'all 0.2s ease'
- });
- closeBtn.addEventListener('mouseenter', () => {
- setStyle(closeBtn, {
- background: 'rgba(255, 255, 255, 0.2)',
- transform: 'rotate(90deg)'
- });
- });
- closeBtn.addEventListener('mouseleave', () => {
- setStyle(closeBtn, {
- background: 'rgba(255, 255, 255, 0.1)',
- transform: 'rotate(0deg)'
- });
- });
- const textareaContainer = document.createElement('div');
- setStyle(textareaContainer, {
- position: 'relative',
- marginBottom: '20px',
- marginTop: '5px',
- borderRadius: '10px',
- transition: 'all 0.3s ease'
- });
- const textarea = document.createElement('textarea');
- textarea.id = 'brainly-search-input';
- textarea.placeholder = texts.placeholder;
- textarea.rows = 4;
- setStyle(textarea, {
- width: '100%',
- boxSizing: 'border-box',
- padding: '16px',
- border: '2px solid #333',
- borderRadius: '10px',
- fontSize: '16px',
- resize: 'none',
- fontFamily: 'inherit',
- transition: 'border-color 0.3s ease, box-shadow 0.3s ease',
- outline: 'none',
- backgroundColor: '#2d2d2d',
- color: '#e0e0e0'
- });
- textarea.addEventListener('focus', () => {
- setStyle(textarea, {
- borderColor: '#4facfe',
- boxShadow: '0 0 0 3px rgba(79, 172, 254, 0.25)'
- });
- });
- textarea.addEventListener('blur', () => {
- setStyle(textarea, {
- borderColor: '#333',
- boxShadow: 'none'
- });
- });
- textareaContainer.appendChild(textarea);
- const charCounter = document.createElement('div');
- charCounter.textContent = `0 ${texts.chars}`;
- setStyle(charCounter, {
- position: 'absolute',
- right: '10px',
- bottom: '10px',
- fontSize: '12px',
- color: '#999',
- transition: 'color 0.3s ease'
- });
- textareaContainer.appendChild(charCounter);
- textarea.addEventListener('input', () => {
- const count = textarea.value.length;
- charCounter.textContent = `${count} ${count !== 1 ? texts.chars : texts.char}`;
- if (count > 0) {
- setStyle(searchBtn, {
- backgroundColor: '#24a865',
- opacity: '1',
- cursor: 'pointer',
- transform: 'translateY(0)'
- });
- } else {
- setStyle(searchBtn, {
- backgroundColor: '#1c7a4b',
- opacity: '0.8',
- cursor: 'not-allowed',
- transform: 'translateY(2px)'
- });
- }
- });
- const searchBtnContainer = document.createElement('div');
- setStyle(searchBtnContainer, {
- position: 'relative',
- overflow: 'hidden',
- borderRadius: '10px',
- marginBottom: '14px'
- });
- const searchBtn = document.createElement('button');
- searchBtn.id = 'brainly-search-btn';
- searchBtn.innerHTML = `<svg width="20" height="20" viewBox="0 0 24 24" fill="white" style="margin-right:8px"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></svg>${texts.searchBtn}`;
- setStyle(searchBtn, {
- backgroundColor: '#1c7a4b',
- color: 'white',
- border: 'none',
- padding: '14px 20px',
- borderRadius: '10px',
- fontSize: '16px',
- cursor: 'not-allowed',
- width: '100%',
- fontWeight: 'bold',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- transition: 'all 0.3s cubic-bezier(0.19, 1, 0.22, 1)',
- opacity: '0.8',
- transform: 'translateY(2px)',
- position: 'relative',
- outline: 'none'
- });
- searchBtn.addEventListener('click', (e) => {
- if (textarea.value.trim()) {
- addRippleEffect(e, searchBtn);
- const query = textarea.value.trim();
- if (query) {
- setTimeout(() => {
- window.open(`https://${languageData[currentLang].domain}/app/ask?entry=hero&q=${encodeURIComponent(query)}`, '_blank');
- closeModalWithAnimation(modal, container);
- }, 300);
- }
- }
- });
- searchBtnContainer.appendChild(searchBtn);
- const supportBtn = document.createElement('button');
- supportBtn.id = 'brainly-support-btn';
- supportBtn.innerHTML = texts.supportBtn;
- setStyle(supportBtn, {
- backgroundColor: '#2d2d2d',
- color: '#ff7b24',
- border: '2px solid #ff7b24',
- padding: '10px 15px',
- borderRadius: '10px',
- fontSize: '14px',
- cursor: 'pointer',
- width: '100%',
- fontWeight: '500',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- transition: 'all 0.3s cubic-bezier(0.19, 1, 0.22, 1)',
- position: 'relative',
- overflow: 'hidden'
- });
- supportBtn.addEventListener('mouseenter', () => {
- setStyle(supportBtn, {
- backgroundColor: '#ff7b24',
- color: 'white',
- transform: 'translateY(-2px)',
- boxShadow: '0 4px 8px rgba(255, 123, 36, 0.3)'
- });
- });
- supportBtn.addEventListener('mouseleave', () => {
- setStyle(supportBtn, {
- backgroundColor: '#2d2d2d',
- color: '#ff7b24',
- transform: 'translateY(0)',
- boxShadow: 'none'
- });
- });
- supportBtn.addEventListener('click', (e) => {
- addRippleEffect(e, supportBtn);
- setTimeout(() => {
- closeModalWithAnimation(modal, container);
- setTimeout(() => {
- showSupportModal();
- }, 400);
- }, 300);
- });
- const footer = document.createElement('div');
- setStyle(footer, {
- fontSize: '12px',
- color: '#999',
- textAlign: 'center',
- marginTop: '10px',
- opacity: '0.7'
- });
- footer.textContent = texts.footer;
- container.appendChild(closeBtn);
- container.appendChild(textareaContainer);
- container.appendChild(searchBtnContainer);
- container.appendChild(supportBtn);
- container.appendChild(footer);
- modal.appendChild(container);
- document.body.appendChild(modal);
- setTimeout(() => {
- modal.style.opacity = '1';
- container.style.opacity = '1';
- container.style.transform = 'translateY(0) scale(1)';
- setTimeout(() => {
- textarea.focus();
- }, 300);
- }, 50);
- closeBtn.addEventListener('click', () => {
- closeModalWithAnimation(modal, container);
- });
- textarea.addEventListener('keydown', (e) => {
- if (e.key === 'Enter' && !e.shiftKey) {
- e.preventDefault();
- const query = e.target.value.trim();
- if (query) {
- window.open(`https://${languageData[currentLang].domain}/app/ask?entry=hero&q=${encodeURIComponent(query)}`, '_blank');
- closeModalWithAnimation(modal, container);
- }
- }
- });
- modal.addEventListener('click', (e) => {
- if (e.target === modal) {
- closeModalWithAnimation(modal, container);
- }
- });
- }
- function showSupportModal() {
- const overlay = document.createElement('div');
- const banner = document.createElement('div');
- const signature = document.createElement('div');
- overlay.style.cssText = `
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- backdrop-filter: blur(5px) brightness(0.8);
- -webkit-backdrop-filter: blur(5px) brightness(0.8);
- background-color: rgba(0, 0, 0, 0.4);
- z-index: 9998;
- transition: all 0.5s ease;
- opacity: 0;
- `;
- banner.style.cssText = `
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.75);
- width: 1948px;
- height: 940px;
- background-image: url(https://i.imgur.com/qn1xxfD.png);
- background-size: cover;
- background-position: center;
- z-index: 9999;
- opacity: 0;
- transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
- image-rendering: -webkit-optimize-contrast;
- image-rendering: crisp-edges;
- backface-visibility: hidden;
- -webkit-backface-visibility: hidden;
- -webkit-transform-style: preserve-3d;
- transform-style: preserve-3d;
- will-change: transform, opacity;
- `;
- signature.textContent = "by: L4pisD4Silv4";
- signature.style.cssText = `
- position: fixed !important;
- bottom: 70px !important;
- left: 50% !important;
- transform: translateX(-50%) !important;
- color: rgba(255, 255, 255, 0.7) !important;
- font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
- font-size: 12px !important;
- font-weight: 300 !important;
- letter-spacing: 2px !important;
- z-index: 10000 !important;
- opacity: 0;
- transition: opacity 0.8s ease !important;
- text-shadow: 0 1px 4px rgba(0, 157, 255, 0.5) !important;
- text-transform: lowercase !important;
- `;
- document.body.appendChild(overlay);
- document.body.appendChild(banner);
- document.body.appendChild(signature);
- setTimeout(() => {
- overlay.style.opacity = '1';
- banner.style.opacity = '1';
- signature.style.opacity = '1';
- }, 50);
- function fecharBanner() {
- banner.style.opacity = '0';
- banner.style.transform = 'translate(-50%, -50%) scale(0.6)';
- overlay.style.opacity = '0';
- signature.style.opacity = '0';
- setTimeout(() => {
- banner.remove();
- overlay.remove();
- signature.remove();
- }, 800);
- }
- function criarBotao(src, x, y, w, h, link) {
- const btn = document.createElement('div');
- btn.style.cssText = `
- position: absolute;
- left: ${x}px;
- top: ${y}px;
- width: ${w}px;
- height: ${h}px;
- background-image: url(${src});
- background-size: contain;
- background-position: center;
- background-repeat: no-repeat;
- cursor: pointer;
- transition: transform 0.3s ease;
- backface-visibility: hidden;
- -webkit-backface-visibility: hidden;
- -webkit-transform-style: preserve-3d;
- transform-style: preserve-3d;
- will-change: transform;
- `;
- btn.addEventListener('mouseenter', () => {
- btn.style.transform = 'scale(1.1)';
- });
- btn.addEventListener('mouseleave', () => {
- btn.style.transform = 'scale(1)';
- });
- btn.addEventListener('click', () => {
- if (link) window.open(link, '_blank');
- else fecharBanner();
- });
- return btn;
- }
- banner.appendChild(criarBotao(
- 'https://i.imgur.com/6C466vU.png', 985, 649, 132, 150,
- 'https://linktr.ee/L4pisd4silv4'
- ));
- banner.appendChild(criarBotao(
- 'https://i.imgur.com/T32os95.png', 1308, 651, 426, 116,
- 'https://ko-fi.com/l4pisd4silv4'
- ));
- banner.appendChild(criarBotao(
- 'https://i.imgur.com/HbC1dXb.png', 1773, 788, 52, 52
- ));
- overlay.addEventListener('click', fecharBanner);
- }
- function setStyle(element, styles) {
- for (const property in styles) {
- element.style[property] = styles[property];
- }
- }
- function closeModalWithAnimation(modal, container) {
- container.style.opacity = '0';
- container.style.transform = 'translateY(20px) scale(0.95)';
- modal.style.opacity = '0';
- setTimeout(() => {
- modal.remove();
- }, 400);
- }
- function addRippleEffect(e, element) {
- const ripple = document.createElement('span');
- const rect = element.getBoundingClientRect();
- const x = e.clientX - rect.left;
- const y = e.clientY - rect.top;
- setStyle(ripple, {
- position: 'absolute',
- borderRadius: '50%',
- backgroundColor: 'rgba(255, 255, 255, 0.7)',
- width: '10px',
- height: '10px',
- left: x + 'px',
- top: y + 'px',
- transform: 'scale(0)',
- pointerEvents: 'none',
- transition: 'all 0.6s cubic-bezier(0.19, 1, 0.22, 1)'
- });
- element.appendChild(ripple);
- setTimeout(() => {
- setStyle(ripple, {
- transform: 'scale(20)',
- opacity: '0'
- });
- setTimeout(() => {
- ripple.remove();
- }, 600);
- }, 10);
- }
- function initializeUnlocker() {
- const limparTudo = () => {
- document.cookie.split(";").forEach(cookie => {
- const [key] = cookie.split('=');
- if (key.trim().match(/^(session|auth)/i)) {
- document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
- }
- });
- try {
- localStorage.clear();
- indexedDB.deleteDatabase('Brainly');
- } catch(e) {}
- for (let key in window) {
- if (key.includes('SESSION') || key.includes('_SESSION_')) {
- window[key] = undefined;
- }
- }
- window.__USER_DATA__ = undefined;
- };
- function fecharPopupsBrainly() {
- const registrationPopup = document.querySelector('[data-testid="registration_toplayer_close_button"]');
- if (registrationPopup) {
- console.log('Fechando popup de registro do Brainly');
- registrationPopup.click();
- }
- const offerDialogs = document.querySelectorAll('[data-dialog-container="true"].sg-dialog__container--open');
- offerDialogs.forEach(dialog => {
- const isImageModal = !!dialog.querySelector('[data-testid="attachments_modal_dialog_body"]');
- if (!isImageModal) {
- const closeButton = dialog.querySelector('.sg-dialog__close-button');
- if (closeButton) {
- console.log('Fechando popup de oferta do Brainly');
- closeButton.click();
- }
- }
- });
- }
- const popupCloserInterval = setInterval(fecharPopupsBrainly, 500);
- window.addEventListener('beforeunload', () => {
- clearInterval(popupCloserInterval);
- });
- const originalOpen = XMLHttpRequest.prototype.open;
- XMLHttpRequest.prototype.open = function(method, url) {
- if (url && url.includes('/api/auth/check')) {
- this.addEventListener('load', () => {
- if (this.readyState === 4) {
- console.log('Modificando resposta de autenticação');
- Object.defineProperty(this, 'responseText', {
- value: JSON.stringify({ isAuthenticated: false })
- });
- }
- });
- }
- originalOpen.call(this, method, url);
- };
- const observer = new MutationObserver(mutations => {
- mutations.forEach(mutation => {
- mutation.addedNodes.forEach(node => {
- if (node.nodeType === 1) {
- if (node.classList?.contains('brn-answer__content--locked')) {
- node.style.cssText = 'filter:none!important; opacity:1!important;';
- }
- }
- });
- });
- });
- const css = `
- .brn-answer__content--locked,
- .js-paywall,
- .blurred-container,
- .sg-overlay {
- filter: none !important;
- opacity: 1 !important;
- pointer-events: auto !important;
- }
- [data-test="paid-content"] { display: block !important; }
- `;
- document.head.insertAdjacentHTML('beforeend', `<style>${css}</style>`);
- limparTudo();
- observer.observe(document.body, { childList: true, subtree: true });
- setInterval(limparTudo, 3000);
- const copyButtonCSS = `
- .brainly-copy-btn {
- position: static;
- display: inline-flex;
- width: 30px;
- height: 30px;
- background-color: #2d5af6;
- color: white;
- border: none;
- border-radius: 50%;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- transition: all 0.2s ease;
- opacity: 0.7;
- box-shadow: 0 2px 5px rgba(0,0,0,0.2);
- flex-shrink: 0;
- z-index: 10;
- }
- .brainly-copy-btn:hover {
- transform: scale(1.1);
- opacity: 1;
- background-color: #1a3fc3;
- }
- .brainly-copy-btn--author {
- margin-left: auto;
- }
- .brainly-copy-btn--answer {
- margin-right: 8px;
- }
- .brainly-copy-btn--ai {
- margin-left: 8px;
- width: 28px;
- height: 28px;
- }
- .brainly-copy-notification {
- position: fixed;
- bottom: 20px;
- right: 20px;
- background-color: #24a865;
- color: white;
- padding: 12px 20px;
- border-radius: 8px;
- font-size: 14px;
- z-index: 999999;
- box-shadow: 0 3px 10px rgba(0,0,0,0.3);
- opacity: 0;
- transform: translateY(20px);
- transition: opacity 0.3s ease, transform 0.3s ease;
- }
- .brainly-copy-notification.show {
- opacity: 1;
- transform: translateY(0);
- }
- `;
- document.head.insertAdjacentHTML('beforeend', `<style>${copyButtonCSS}</style>`);
- function createCopyButton(className = '') {
- const copyBtn = document.createElement('button');
- copyBtn.className = `brainly-copy-btn ${className}`.trim();
- copyBtn.title = languageData[currentLang]?.notifications?.copyTooltip || 'Copy answer';
- copyBtn.innerHTML = `<svg width="16" height="16" viewBox="0 0 24 24" fill="white">
- <path d="M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z"></path>
- </svg>`;
- return copyBtn;
- }
- function addCopyButtonsToAnswers() {
- const answerBoxes = document.querySelectorAll('[data-testid="answer_box_wrapper"]');
- answerBoxes.forEach(answerBox => {
- if (answerBox.querySelector('.brainly-copy-btn')) return;
- const authorElement = answerBox.querySelector('[data-testid="answer_box_author_link"]')?.closest('.sg-flex');
- if (authorElement) {
- const copyBtn = createCopyButton('brainly-copy-btn--author');
- copyBtn.addEventListener('click', function(e) {
- e.preventDefault();
- e.stopPropagation();
- const answerContent = answerBox.querySelector('[data-testid="answer_box_text"]');
- if (answerContent) {
- copyTextToClipboard(answerContent.innerText);
- }
- });
- authorElement.appendChild(copyBtn);
- }
- });
- const brainlyComAnswers = document.querySelectorAll('[data-testid="answer_layout"]');
- brainlyComAnswers.forEach(answerLayout => {
- if (answerLayout.querySelector('.brainly-copy-btn')) return;
- const headerElement = answerLayout.querySelector('[data-testid="answer_header_regular"], [data-testid="answer_header_expertVerified"]');
- if (!headerElement) return;
- const optionsArea = headerElement.querySelector('._37eFE7tYjx8SdXBXlq1thn');
- if (!optionsArea) return;
- const copyBtn = createCopyButton('brainly-copy-btn--answer');
- copyBtn.addEventListener('click', function(e) {
- e.preventDefault();
- e.stopPropagation();
- let textToCopy = "";
- const safeHtmlElements = answerLayout.querySelectorAll('[data-testid="safe_html"]');
- if (safeHtmlElements && safeHtmlElements.length > 0) {
- safeHtmlElements.forEach(element => {
- textToCopy += element.innerText + "\n\n";
- });
- } else {
- const answerContent = answerLayout.querySelector('[data-testid="safe_html"]');
- if (answerContent) {
- textToCopy = answerContent.innerText;
- }
- }
- if (textToCopy) {
- copyTextToClipboard(textToCopy.trim());
- }
- });
- optionsArea.parentNode.insertBefore(copyBtn, optionsArea);
- });
- const aiAnswers = document.querySelectorAll('[data-testid="gpt_answer"]');
- aiAnswers.forEach(aiAnswer => {
- if (aiAnswer.querySelector('.brainly-copy-btn')) return;
- const headerElement = aiAnswer.querySelector('.sg-flex--align-items-center');
- if (!headerElement) return;
- const copyBtn = createCopyButton('brainly-copy-btn--ai');
- copyBtn.addEventListener('click', function(e) {
- e.preventDefault();
- e.stopPropagation();
- const answerContent = aiAnswer.querySelector('._3ZOn94ZHryf5v9jZjFZv3j [data-testid="safe_html"]');
- if (answerContent) {
- copyTextToClipboard(answerContent.innerText);
- }
- });
- headerElement.appendChild(copyBtn);
- });
- }
- function copyTextToClipboard(text) {
- navigator.clipboard.writeText(text)
- .then(() => {
- showCopyNotification();
- })
- .catch(err => {
- console.error('Erro ao copiar texto: ', err);
- const textarea = document.createElement('textarea');
- textarea.value = text;
- textarea.style.position = 'fixed';
- textarea.style.opacity = '0';
- document.body.appendChild(textarea);
- textarea.select();
- document.execCommand('copy');
- document.body.removeChild(textarea);
- showCopyNotification();
- });
- }
- function showCopyNotification() {
- const notification = document.createElement('div');
- notification.className = 'brainly-copy-notification';
- notification.textContent = languageData[currentLang]?.notifications?.copied || 'Answer copied!';
- document.body.appendChild(notification);
- setTimeout(() => {
- notification.classList.add('show');
- setTimeout(() => {
- notification.classList.remove('show');
- setTimeout(() => {
- notification.remove();
- }, 300);
- }, 2000);
- }, 10);
- }
- addCopyButtonsToAnswers();
- setInterval(addCopyButtonsToAnswers, 2000);
- }
- function setupEventHandlers() {
- registerMenuCommands();
- document.addEventListener('keydown', function(e) {
- if (e.key === 'Enter' && e.shiftKey) {
- e.preventDefault();
- showSearchModal();
- }
- });
- if (isBrainlySite()) {
- initializeUnlocker();
- }
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', setupEventHandlers);
- } else {
- setupEventHandlers();
- }
- })();