// ==UserScript== // @name KП → SSпоиск кнопка (финальная версия) // @namespace http://tampermonkey.net/ // @version 1.3 // @description Кнопка полностью сливается с дизайном: жирный текст, правильный шрифт, высота по полю ввода // @author ChatGPT // @match *://www.kinopoisk.ru/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; function addButton() { // Ищем контейнер строки поиска let searchContainer = document.querySelector('.styles_searchFormContainer__GyAL5'); if (!searchContainer) return; // Определяем правильный чёрный цвет из фона let computedStyle = window.getComputedStyle(searchContainer); let backgroundColor = computedStyle.backgroundColor; // Создаём кнопку let button = document.createElement('button'); button.innerText = 'Смотреть онлайн'; button.style.cssText = ` background: ${backgroundColor}; color: gray; border: none; padding: 0 12px; font-size: 15px; font-weight: 600; font-family: "YS Text", Arial, sans-serif; border-radius: 5px; cursor: pointer; height: ${searchContainer.offsetHeight}px; display: flex; align-items: center; justify-content: center; margin-left: 10px; `; button.onclick = function() { let newUrl = window.location.href.replace('kino', 'ss'); window.open(newUrl, '_blank'); }; // Вставляем кнопку правее поиска searchContainer.parentNode.insertBefore(button, searchContainer.nextSibling); } // Ждём, пока загрузится DOM window.addEventListener('load', addButton); })();