Simple little browser extension which allows you to filter works from Archive of Our Own's (AO3) search using regular expressions.
Unfortunately, there is no simple way to install this since to release to an extension on Google Chrome or Mozilla Firefox a lot of information has to be released.
So you'll have to install the extension via side loading it.
For Chrome:
- Download the latest zip from the releases page.
- Unpack the zip in some directory where the extension will live.
- In Chrome go to
chrome://extensions
and click onLock Unpacked
, navigate to where the zip was unpacked and hit select. - Done!
For Firefox:
Unless you are running Firefox Nightly, you can't use this. Mozilla has taken a much harder stance on running unsigned extensions and since I'm not willing to submit it to their signing service, you're out of luck.
If you are using Firefox Nightly:
- Download the latest zip from the releases page.
- In Firefox Nightly go to
about:config
, searchxpinstall.signatures.required
, and set it to false. - Once that is complete go to
about:addons', click on the gear in the top right underneath the search bar, and select
Install Add-on From File...`. - Navigate to the directory where the zip file is located and select it.
- Done!
The extension has one pane and no other configuration options.
The pane has two buttons and one text area which houses the terms you want to filter out.
The top button denotes whether the extension is on or off through a green checkmark or a red cross, respectively.
The text area takes regular expressions to search each work on a search page for the pattern and if found hide the work. Each line in the text area is a seperate regular expression and all regular expresions match case-insensitve.
The regex applies to the entire HTML of the work element, meaning that poorly constructed searches can lead to hiding all works.
Finally after adding some patterns to match against, the bottom button saves and applies the search right away.
This abuses regular expressions to either state whether a work is filtered or not. If it is filtered it sets the work to be hidden by toggling a CSS class which specifies display: hidden;
.
Filter works which contain the term hiatus, haitus, hiitus, or haatus.
h[ai]{2}tus
Filter works on just containing a term like twin
twin
Filter works that have Hermione Granger in a pairing with anyone that is not Harry Potter. This does use some specific knowledge that the H/Hr pairing is Hermione Granger/Harry Potter
on AO3.
hermione.granger\/(?!harry.potter)|\/hermione.granger
Feel free to open an Issue if you discover a bug or weird edge case. If you just have a question or comment open up a discussion post.
I generally don't see this breaking due to the code itself, but changes in the Browser Extension APIs and interfaces (ie. Manifest v2 vs v3). If it does and there isn't a fix, free free to push a pull request or just open an issue.