TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Share your favorite tampermonkey script

18 点作者 mr_o47将近 2 年前
Hello,<p>What’s your favorite tampermonkey script which might have saved you hours

5 条评论

spdustin将近 2 年前
I wrote a script I use on an e-commerce site where hundreds of products are added in largely random order throughout the day. The product SKUs just happen to be in data-* HTML attributes, so I chuck them into an array that gets stored in localStorage. On each subsequent refresh, any product with a SKU that wasn’t seen previously gets a CSS background applied to its container, and is moved to the top of the listing. The new items’ SKUs are merged back into the locslStorage array, ready for the next refresh.<p>There are also category listings on the side of this page that include a count of the items in each category, so I store those values in localStorage as well, and compute the delta on each refresh. The category is then highlighted with a pale green or pale red background if the count increased or decreased, respectively. Finally, I append the delta amount to the element’s text. “Widgets and Frambulators (17)” turns into “Widgets and Frambulators (17) (+5)” if five new items are in that category since the last page load.<p>Thankfully, this site uses CSS Grids for this particular product listing, so moving a container to the top is as simple as setting its order property to 1.
fragmede将近 2 年前
write full blown extensions (with the help of ChatGPT) instead of using tampermonkey.<p>the two that I have are inline hacker news commenting, and Amazon item descriptions in my gmail instead of just the order id
bccdee将近 2 年前
I once wrote a tampermonkey script to page through discord search results, scrape the contents, and post them to a local http server. I managed to scrape the most of the contents of an entire server this way without any API access. That would have basically been impossible to do without a userscript.<p>There&#x27;s also the script I use to send me a desktop notification (again, by pinging a local http server) whenever I&#x27;ve been spending too much time on Twitter. That&#x27;s saved me hours in a different sense.
ggeorgovassilis将近 2 年前
I used to heavily augment (don&#x27;t have the scripts anymore though) Tribal Wars (a web game) with features to compute army travel times, automate build queues etc.
dean2432将近 2 年前
Open links from hackernews in new tab
评论 #36371186 未加载
评论 #36338955 未加载