More detailed explanation on how to add filtersIn the `search_filters` array, each filter object has a `params` property. This property contains the query parameters that define the specific filter criteria. When you click on a filter button, the script constructs a URL by appending the `params` value to the base URL of the Tag Tracker page.
To create a new custom filter button, follow these steps:
1. Go to the Tag Tracker page (https://repo.e-hentai.org/tools/tagtrack)
2. Use the available form fields to set up your desired filter criteria (e.g., select specific options, enter tags, etc.).
3. Click the "Go" button to apply the filter.
4. After the page reloads with the filtered results, look at the URL in your browser's address bar.
5. Find the part of the URL that comes after the question mark (`?`). This part contains the query parameters representing your filter criteria.
6. Copy everything after the `?` in the URL.
7. In the userscript, add a new object to the `search_filters` array.
8. Set the `label` property to the desired button text.
9. Set the `params` property to the copied query parameters (excluding the `?`).
10. Save the userscript.
For example, let's say you applied a filter on the Tag Tracker page, and the resulting URL looks like this:
CODE
https://repo.e-hentai.org/tools/tagtrack?w=on&a=on&filter_uid=123&filter_tag=example&go=Go
To create a button for this filter, you would add the following object to the `search_filters` array:
CODE
{
label: 'My Custom Filter',
params: 'w=on&a=on&filter_uid=123&filter_tag=example&go=Go'
},
Now, when you click on the "My Custom Filter" button, the script will construct the URL by appending the `params` value to the base URL, resulting in:
CODE
https://repo.e-hentai.org/tools/tagtrack?w=on&a=on&filter_uid=123&filter_tag=example&go=Go
If you want to only filter a specific category, for example 'Cosplay', 'Manga' and 'Artist CG' you can add the `category` property.
CODE
{
label: 'My Custom Filter',
params: 'w=on&a=on&filter_uid=123&filter_tag=example&go=Go',
category: 'Cosplay, Manga, Artist CG'
},
Now, when you click on the "My Custom Filter" button, the script will also only show Cosplay, Manga and Artist CG galleries on that specific filter. By default the `category` property does not need to be included and all categories will be visible.
This post has been edited by -terry-: Apr 3 2024, 18:21