Są jakieś fajne usersripty do hejto? Na greasy/tampermonkey. #hejto
Są jakieś fajne usersripty do hejto? Na greasy/tampermonkey.
#hejto
Są jakieś fajne usersripty do hejto? Na greasy/tampermonkey.
#hejto
@cherronimo jak to nic nie ma!? A ten? https://greasyfork.org/en/scripts/494516-hejto-next-notification/code
( ͡° ͜ʖ ͡°)
@vrkr o widzisz, coś z szukajką tam źle zrobiłem. Ale tutaj Claude zrobił skrypt do rozwijania "pokaż więcej odpowiedzi/komentarzy" po najechaniu myszka.
// ==UserScript==
// @name Hejto.pl - expand on hover
// @namespace https://hejto.pl/
// @version 1.0
// @description Automatically clicks "show more" and "show more comments" when hovered
// @match https://www.hejto.pl/*
// @match https://hejto.pl/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function () {
'use strict';
// Matches: "pokaż więcej", "pokaż więcej komentarzy", "pokaż więcej odpowiedzi",
// optionally followed by a count like "(12)"
const LABEL_REGEX = /^(pokaż|zobacz|rozwiń)\s+więcej(\s+(komentarzy|odpowiedzi))?(\s*[USER_SLASH] )?\.{0,3}$/i;
// Minimum delay between clicks on the same element (ms)
const COOLDOWN_MS = 800;
// How many parent levels to check, in case the hovered node is an inner span/icon
const MAX_DEPTH = 3;
const lastClick = new WeakMap();
function findTarget(start) {
let el = start;
for (let i = 0; i <= MAX_DEPTH && el && el !== document.body; i++) {
const text = (el.textContent || '').replace(/\s+/g, ' ').trim();
if (text.length <= 40 && LABEL_REGEX.test(text)) {
return el;
}
el = el.parentElement;
}
return null;
}
function isSafeToClick(el) {
// Do not trigger real navigation links, only in-page expanders
const link = el.closest('a[href]');
if (link) {
const href = link.getAttribute('href') || '';
if (href && !href.startsWith('#') && !href.startsWith('javascript:')) {
return false;
}
}
return true;
}
document.addEventListener(
'mouseover',
(event) => {
const target = findTarget(event.target );
if (!target || !isSafeToClick(target)) return;
const now = Date.now ();
if (now - (lastClick.get(target) || 0) < COOLDOWN_MS) return;
lastClick.set(target, now);
target.click ();
console.debug('[Hejto expand] Clicked:', target.textContent.trim());
},
true
);
})();
Tylko wcięcia się rozjechały.
https://pastes.io/gDLWbBVI
Pastebin jest wylączone, pastes.io daje tylko na miesiąc więc zostawiam i tak i tak.
Zaloguj się aby komentować