Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Fix Font Obfuscation (Show Real Text)
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Wymusza standardową czcionkę, aby odsłonić prawdziwy tekst ukryty pod obfuskacją
- // @author You
- // @match *://freedisc.pl/*
- // @grant GM_addStyle
- // @run-at document-start
- // ==/UserScript==
- (function() {
- 'use strict';
- // Ta funkcja dodaje style CSS, które nadpisują czcionki na stronie
- function injectStyles() {
- // Lista bezpiecznych, standardowych czcionek systemowych
- const safeFonts = "'Segoe UI', Arial, Helvetica, sans-serif";
- // Tworzymy regułę CSS, która wymusza te czcionki na (prawie) wszystkim
- // Używamy !important, aby nadpisać style strony
- const css = `
- * {
- font-family: ${safeFonts} !important;
- }
- /* Czasami strony używają ikon jako czcionki - staramy się ich nie psuć,
- ale w tym przypadku priorytetem jest czytelny tekst */
- `;
- // Metoda dodawania stylu zależna od środowiska
- if (typeof GM_addStyle !== "undefined") {
- GM_addStyle(css);
- } else {
- const style = document.createElement('style');
- style.textContent = css;
- (document.head || document.documentElement).appendChild(style);
- }
- }
- // Uruchamiamy natychmiast
- injectStyles();
- // Obserwator zmian (gdyby strona ładowała elementy dynamicznie/AJAX)
- const observer = new MutationObserver(() => {
- // Ponowne nałożenie stylów w przypadku dodania nowych elementów
- injectStyles();
- });
- if (document.body) {
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- }
- })();
Advertisement