FIMFiction UserScripts 383 members · 0 stories
Comments ( 34 )
  • Viewing 1 - 50 of 34

Fimfiction Comment Bookmarks

I've been working on this script for the past month or so. Born out of a narcissistic desire to keep track of my own comments, this script adds a little bookmark button to comments found on the site, whether it is from a story, blog post, user profile, or even forum threads, and also lets you filter and search through the saved bookmarks.

Install

This script requires the extension Tampermonkey/Violentmonkey and has been tested to work on Chrome and Firefox.
Install from Github repo
Install from OpenUserJS

Features

  • The script supports story comments, blog comments, forum threads, and profile page comments.
  • The saved comments can be accessed from the new "Bookmarks" button in the site's navigation bar.
  • The comments are stored as plain text, you can use the 'live preview' toggle to display it with formatting and vote counts.
  • The bookmarks can be sorted and displayed by:

    • When the comment was made.
    • When the bookmark was added.
    • Parent post, where the bookmarks are grouped together by the post they belong to.
  • Filtering by comment categories.
  • Basic text search functionality that works on:

    • Title: Everything that is displayed in the comment title, this includes: story and chapter name, the author name, or the group the forum post belongs to.
    • Comment: Main body of the comment.
    • Commenter: The author of the comment.
  • Support for Fimfiction's dark mode and mobile view.
  • Changes to the bookmarks are synced across open tabs.
  • Import and export, for backup or transferring saved bookmarks to another browser or computer.

Screencaps


Bookmark button


Live preview


Category filter


Text search, when sorted by parent post


Dark mode support


Bookmarks stay in sync across tabs (also basic mobile UI support, in case your browser of choice happens to support userscripts)

My other stuffs

You might also like these other scripts I've written for Derpibooru:

Wow, this is amazing! Just a short time ago, I wished that FIMFiction had a way to track comments just like Derpibooru has, for making it possible to archive single comments! I am going to install this right away! :scootangel:

TEST COMMENT, to see how it looks when two comments are bookmarked.


Edit: TEST EDIT

Edit 2: Hmm, editing a comment requires to bookmark it again to get the changes. But automatic updating is probably not necessary, so that's not much of an issue.
Thanks for making this script, this is going to be great for archiving purposes!

Edit 3: But I maybe found a little bug: The edits of a comment after it was bookmarked again show up in plain view only. The live preview does not display edits. Is this intended?

6732308
Thanks! I'm glad that you find it useful!

The live preview does not display edits. Is this intended?

Kind of, the live previews have to be fetched from the server, so the responses are saved in memory to cut down on the laterency and number of requests. The cache is cleared when you refresh the page, and the stored responses are also set to expire and have to be fetched again after an hour.

As for the plain text representations, they are meant to automatically update when it detects the comments been edited (either when visiting the page or fetching live previews), so I guess the serving of cached previews with the pre-edited comments kind of messed that up a little, I'll have that fixed in the next update, but the good news is it should just sort itself out if you refresh the page.

6732562

Now it works. No idea what changed, but the edits show up in the live preview now. Also, I just noticed you can export all the comments in one .json file.
Do you know how to open these files and make the comments viewable in them?

6732663
They are text files and you should be able to open them with any text editor. Although you will want to reformat them with something like https://jsonformatter.curiousconcept.com/ to make it more readable.

6732675

Thanks. I was just curious what to do with these files, as the Tumblr blogs I recently downloaded also came with a huge number of .json files and I haven't yet received a response on my question if a Tumblr blog can be rebuilt with the help of these files in the thread on Derpibooru.
If I archive comments from here, I will make screenshots or use the WaybackMachine, which your script makes possible now, as I can finally find comments I've written again with it.

Version 1.0.1 update:

  • Changed how the import button works. Importing a backup now will merge the new bookmarks with the existing collection, instead of deleting the existing bookmarks like before.
  • Added a new 'clear' button to delete all the bookmarks.
  • Images and other embeds should work normally in live previews now.
  • Fixed a bug with the caching of live preview responses.
  • Fixed saved bookmarks not updating after comment was edited.
Sollace
Group Admin

Oh, very nice!

It makes me very happy to see this group isn't entirely dead!

Minor update (1.0.3):
Changes made to how script handles blockquotes when converting them to plain text. For example, the following:

Stuff inside quote with some formatting
Another line

  1. numbered list
  2. numbered list
    • nested list
    • nested list

Nested quote
Multiline drifting

  • bulleted list
  • bulleted list

should yield:

>Stuff inside quote with some formatting
>Another line

> 1. numbered list
> 2. numbered list
> 3. 
 - nested list
 - nested list

>>Nested quote
>>Multiline drifting

>> - bulleted list
>> - bulleted list

when saved as bookmark.

6736138
Thanks for the encouragement! I've been wanting to write something like this for a while now, but was always somewhat intimidated by the complexity whenever I tried to make a start.

Sollace
Group Admin

6737208
Indeed. Even just ensuring a comment has its buttons added even when changing pages is a tricky task. That is specifically why I made FimficEvents to habdle that

6737303
Very interesting, it looks like your script works by intercepting the ajax calls and dispatching events based on that? I'm afraid understanding how it works fully is a bit beyond my current ability.

Me? I just use MutationObserver to monitor for new page elements instead. I use it in practically everything I wrote even when it probably isn't strictly necessary, it's a bit like that proverb about hammer and nails I suppose...

Sollace
Group Admin

6737339
Eeyup! It intercepts ajax calls and provides events for all the most common site actions.

I never really used mutation observer. Think I saw something about it saying they were terrible dor performance, but that's about it.

6737400
I admit I'm definitely not using the API in the most efficient manner possible, and looking at some of the posts I found on the web, I can see I ticked several of those "don'ts" checkmarks in my code. :twilightsheepish:

But in general usage, despite my terrible practices I never experience any perceptible performance hits, and after the initial page load, there are very few DOM changes to trigger the observer.

Sollace
Group Admin

6740950
That's good then :twilightblush:

For me I've done a lot of work in optimising Fimfic Advanced to have it apply as immediately as possible when the page loads. That's different though, because its changes can be so large the delay between page load and scripts running becomes extremely noticeable.

6732129

I found a bug today. I tried to bookmark a comment I wrote under the newest interview by the Royal Canterlot Library, but it doesn't let me. At first I thought there's a limit to the number of comments I can bookmark at the same time, but even after I temporarily removed the last bookmark on the list, it still didn't work. So it seems that comments under site news can't get bookmarked.
Here's the comment I tried to bookmark:

https://www.fimfiction.net/blog/844263/coffeeminions-petunia-and-the-coelacanth-royal-canterlot-library#comment/5006441

6747561
Sorry, I'm away on a trip right now, I'll take a look at it when I get home which is in about two weeks.

6747561
Should be fixed now.

6763856

I haven't had time to check this yet, but, why are all my comment bookmarks suddenly gone after I came online today? The settings are completely resetted, too, but I didn't touch anything. Have you updated the script somehow?

6782542
No, I haven't made any changes since the bugfix 2 weeks ago. Are the site's local settings affected too? Have you done anything like clearing your browser's or the site's local storage?

The script uses IndexedDB to store the bookmarks, open up your browser's developer tools and see if they've been deleted somehow. In Chrome it's under the 'Application' tag, in Firefox it's called 'Storage'.

Also, check the console for error messages.

6782545

Laden fehlgeschlagen für das ("Failed to load" in english) <script> mit der Quelle (with the source) "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js". userscript-comment-bookmarking:93:1

Is this it? I deleted my cookies for FIMFiction.net once on Saturday, could this be the cause?

6782702

I deleted my cookies for FIMFiction.net

That sounds like the most probable cause. Depending on how it's done, it's possible for all the site data (cookies, localStorage and IndexedDB) to be deleted along with the cookies.

You could try backing up the bookmarks and deleting the cookies the same way you did it before and see if the same thing happens again.

6732129

I might have found a new bug. Today I noticed that the bookmarks userscript has suddenly disappeared from the top bar. Tampermonkey told me there aren't any installed userscripts (yours is the only Tampermonkey userscript I have), so I had to reinstall the script. I was already panicking about the deletion of all my comment bookmarks since 2019, but thankfully, the script remembered them somehow.
I wasn't uninstalling the userscript, so could this be a new bug that made the userscript disappear from Tampermonkey?

7675622
If it's a bug, then the issue is with the Tampermonkey extension, because to my knowledge it's not possible for a script to uninstall itself, either deliberately or otherwise.
The bookmarks persists on reinstall because the storage mechanism used is tied to a site's domain, not the script itself.
Nonetheless, if you care about losing bookmarks I would strongly recommend making regular backups via the "Export" function.

7675662

Thanks, I wasn't aware of that function yet. I will do that and save all comments I've bookmarked so far.
There is a different problem now, though. Now the script simply stopped working. It's still installed and I have the "Bookmarks" tab in my top bar and can also open it, but I can't see any of my bookmarks. And the button used to bookmark comments is now invisible, it exists and when I hover above it, I still see the message "Bookmark this comment", but I can't see the icon for it and when I press it, I can't tell if the comment has been bookmarked. I suppose that's a bug by the script itself, because Tampermonkey works as it should.

Edit: Exporting the bookmarks also doesn't work. I suppose clicking on "Export" would initiate a file download in Firefox, but nothing happens.

7679779
I'm unable to reproduce your issue on Firefox+Tampermonkey.
If you have any other userscripts/styles/themes installed, try disabling them all to see if they are causing conflicts.
If the problem still persists, open the dev tools (F12 on the keyboard) and tell me if there are any error messages.

Exporting the bookmarks also doesn't work. I suppose clicking on "Export" would initiate a file download in Firefox, but nothing happens.

Another window is supposed to pop up:

7679958

I haven't installed any new userscripts that could be conflicting and with the ones I have, it always worked perfectly.

Now it suddenly works a little better, the bookmark icon at comments is back, I can bookmark comments again and the export happens now, but all my bookmarks are gone. Downloading the .json file also creates a suspiciously small file of only 99 bytes, so it doesn't seem like my bookmarked comments are in the file either.

Edit: Here's a screenshot of the dev tools:

7680078
Yeah, sounds like the bookmarks are gone.

Edit: not a very helpful screenshot without at least showing me the Konsole... If you want to double check the state of the bookmarks database, switch to Web-Speicher and see if there's anything under IndexedDB. It should look something like this if the bookmarks are still there:

7680090

not a very helpful screenshot without at least showing me the Konsole...

Not very helpful without telling me about the console...? You have told me to press F12 and that's what I did. Not everyone is a web programmer, I have no idea about that stuff. If I had, don't you think I would fix the problem myself?
.

If you want to double check the state of the bookmarks database, switch to Web-Speicher and see if there's anything under IndexedDB. It should look something like this if the bookmarks are still there:

Did that and there's exactly one bookmark in it..... the one of my previous comment. How can the bookmarks disappear like that, when even uninstalling the userscript keeps them around? You said they are stored on another site, shouldn't that mean they are still accessible by the script?

7680173
The bookmarks are still stored locally in your browser, but is associated with the domain www.fimfiction.net. They get erased if you, for instance, decided to clear the data for the site or for the whole browser. Or sometimes the browser will automatically clear the site data if the PC is running out of storage space.

7680358

Or sometimes the browser will automatically clear the site data if the PC is running out of storage space.

It seems that's what happened then. C: is pretty full right now and I couldn't fix this yet. Is it possible for you to tell me which comments I had bookmarked? Do you have access to a list of bookmarked comments on your end?

7680438
No, everything is stored locally on your own computer, I do not have access to anybody else's bookmarks.

7680439

Great. Guess now I have to manually go through everything to find them all again.....

  • Viewing 1 - 50 of 34