ryanberckmans / already-seen Goto Github PK
View Code? Open in Web Editor NEWAuto-hide Reddit links after you've seen them once. :eyes: (also Hacker News links)
License: MIT License
Auto-hide Reddit links after you've seen them once. :eyes: (also Hacker News links)
License: MIT License
jQuery is used only for CSS selectors. Remove dependency on jQuery by using native APIs like querySelectorAll.
Author: u/AyrA_ch https://www.reddit.com/r/GreaseMonkey/comments/amai2g/autohide_reddit_links_after_youve_seen_them_once/efl4ry1/
Currently, when storage is full, 25% of seen links are erased. Due to an implementation detail these 25% are typically the least recently used/seen.
Formalize "least recently used" as follows
[StoredEntry]
, where StoredEntry is an object containing at least key: string
and lastSeen: UnixTimestamp
[string]
schema; the storage loader should add a "live migration" so that any previously stored links are migrated to the new data structurelastSeen
should be retained.
const entryKeysAlreadySeenIncludingNewOnesOnThisPage = Array.from(new Set(entryKeysAlreadySeen.concat(allEntriesOnPage.map((e) => e.key))));
"If people have configured their browser to purge cookies on exit, localStorage is wiped, too. Tampermonkey provides an internal mechanism at GM_getValue and GM_setValue (doc) that persists and is not counted towards the page store size."
Author: u/AyrA_ch https://www.reddit.com/r/GreaseMonkey/comments/amai2g/autohide_reddit_links_after_youve_seen_them_once/efl4ry1/
I'd be interested to support localStorage as well, perhaps as follows:
Storage
interfaceGenerate dist/already-seen.meta.js
in the build. This file should just be a copy of the header comment block in dist/already-seen.user.js
.
https://openuserjs.org/about/Frequently-Asked-Questions --> search for "meta.js"
Author: u/AyrA_ch https://www.reddit.com/r/GreaseMonkey/comments/amai2g/autohide_reddit_links_after_youve_seen_them_once/efl4ry1/
"Don't minify the script. People don't like installing scripts they can't read directly (nobody knows if your dist is really made from src)."
This may involve swapping closure-compiler
for another build tool.
Author: u/AyrA_ch https://www.reddit.com/r/GreaseMonkey/comments/amai2g/autohide_reddit_links_after_youve_seen_them_once/efl4ry1/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.