Background: The add-on “Searching, PDF Reading & Note-Taking in Add Dialog” stopped working in the latest Anki 25.04 ~ 25.07, so I am trying to fork it and fix it. This add-on is for creating notes from PDFs inside the Editor, and is popular because it used to have 200+ ratings. Development by the original author (fonol, Tom Z) is discontinued around 2022. (The add-on page has been removed and the Github repository is archived)
So far the fix of add-ons broken by the Anki security update is going very well and there have been very few problems (Probably the solution by Glutanimate is working), the IPA add-ons notified in Anki’s release have already been fixed and other broken add-ons can be fixed or replaced.
However the code for Search PDF is complex, functions for searching PDFs and notes, ebooks, pomodoro timers, etc. are all embedded in the Editor. It generates HTML and Javascript in Python and onclick has 500+ uses, so I already know how to fix it but codes are complicated and it takes time to check the operation and cannot be immediately fixed. (I think it is repairable in the long run.)
For now a practical workaround is to monkey-patch “aqt.mediasrv.legacy_page_data” and downgrade to the older version. (e.g. Monkey patch downgraded security version of add-on released (warn users) → gradually replace JavaScript in SearchPDF → make sure it works → release version with security restored)
But I thought that the development of such an add-on that downgrades security might be prohibited by the official Anki or the development community in the first place. (I think basically add-ons can be developed freely but add-ons uploaded to AnkiWeb will be governed by Anki’s terms of service, etc.) Is downgrading recent security updates with add-ons prohibited or very strongly discouraged?