jsmnbom / ao3-enhancements

Enhancements for ArchiveOfOurOwn.org
https://addons.mozilla.org/en-US/firefox/addon/ao3-enhancements/
MIT License
52 stars 5 forks source link

TrackWorks, adds all works to history #6

Closed jsmnbom closed 2 years ago

jsmnbom commented 3 years ago

TrackWorks works by opening the work page in the background and looking and the sub button, bookmark button and the kudos at the bottom. This means that each work that it checks gets added to the AO3 history.

This is definitely a bug, but I have no idea how to fix, as it's impossible to find out weather a work is subbed or bookmarked without one the following:

jsmnbom commented 3 years ago

Looks like a fix might be to use the current solution, but using Googlebot as the user-agent. According to https://stackoverflow.com/questions/42815087/sending-a-custom-user-agent-string-along-with-my-headers-fetch this might be impossible on chrome at the moment however.

Edit: Actually that might not be the case. my history simply isn't updated at all right now... I wonder if it's cached somehow... Edit2: Yea the history is cached for around half an hour. And from reading AO3 code, the user-agent has no influence on the history :(

jsmnbom commented 2 years ago

Next version will have track works removed entirely, and a hopefully better version implemented soon. That was the best fix I could do for now.