1
Fork 0

e621: handle recent posts on user pages

This commit is contained in:
Conduitry 2020-08-24 12:17:48 -04:00
parent 4835e14a8a
commit 612af87d16

View file

@ -4,7 +4,7 @@
// @description A script to make browsing e621.net while not signed in more convenient, and to work around the global blacklist forced on anonymous users.
// @match https://e621.net/*
// @icon https://e621.net/favicon.ico
// @version 2020.08.24.031122
// @version 2020.08.24.161748
// ==/UserScript==
// wrapper around URLSearchParams to simplify creating search queries
@ -163,6 +163,15 @@ const augment_results = (container, posts, link_params) => {
augment_results(document.querySelector('#wiki-page-posts'), posts, { q: tag });
}
} else if (/^\/users\/\d+/.test(location.pathname)) {
// on user pages, re-add most recent 6 posts blocked by global blacklist
if (document.querySelectorAll('.user-uploads .vertical-section article').length < 6) {
const tag = decodeURIComponent(document.querySelector('.user-uploads a').getAttribute('href').slice(12));
const { posts } = await make_request('/posts.json', { tags: tag, limit: 6 });
augment_results(document.querySelector('.user-uploads .vertical-section'), posts, { q: tag });
}
}
// fetch avatars and thumbnails in comments blocked by global blacklist