Automatically adds the fic info (title, author, series/workID, and summary) to the bookmark notes while preserving any existing notes. It also adds word count tags or a "WIP" tag. Automatically sets all new bookmarks to default to being private as well. Great for tracking bookmarks. Helpful for re-readers! Or to figure out what that deleted fic used to be! (Note this is included in my AO3 Re-read Savior script)
< 脚本AO3 Bookmark Maker (Adds title, author, workID, summary to bookmark notes automatically)的反馈
P.S. I've used backticks to form strings in my code (they're called template literals/template strings (SE | MDN) and they're really neat) but they're not compatible with Internet Explorer, so if you plan to implement any of my code suggestions and you want to keep compatibilty with IE you'll want to replace those with single or double quotes.
Thank you so much for your help fixing the issue with Anonymous authors! I've incorporated the code into the update :)
Hi there, really like the userscript but I just wanna add a few things. You've mentioned in the user-config area of the script that Anonymous accounts break the
author
variable. While I haven't extensively tested what I'm about to comment, I've found that for normal works you can useto retrieve the author name regardless of whether it's a normal user, Anonymous, or orphan_account.
When it comes to series with Anonymous authors, I've found that
works well to retrieve the author name. I understand that it looks a lot messier than using CSS selectors but XPath it a lot more flexible in what it can do, especially since it can ensure that a sibling contains a specific text. The simple explanation is that the above
document.evaluate()
is doing the same thing asdocument.querySelector('#main dl.series.meta.group dt+dd').textContent
but with the additional step of making sure that thedt
element containsCreator
as it's text content.I initially found out about using XPath like this on StackExchange, and if you'd like to read more it's well documented on MDN. Hope this helped.