# Add-ons and 25.02.1 default AnkiWebView api access - workarounds?

**URL:** <https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309>\
**Category:** Add-ons\
**Created:** [April 19, 2025, 5:13am UTC](https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309 "2025-04-19T05:13:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![babofitos](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@babofitos](https://forums.ankiweb.net/u/babofitos)\
**Post date:** [April 19, 2025, 5:13am UTC](https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309/1 "2025-04-19T05:13:47Z")

</div>

The Contanki add-on inherits from AnkiWebView, similarly to my add-on.  
But because of the new security precautions in 25.02.1, if the webview is not one of the specified allowed enums, it won’t have an authorization token inserted in its headers. Because there’s no `kind` set, it defaults to `AnkiWebViewKind.DEFAULT` which isn’t allowed access.  
The quick and hacky fix is to piggyback on one of the whitelisted `AnkiWebViewKinds` when initializing, so something like `super(). __init__ (kind=AnkiWebViewKind.EDITOR)`. I’ve tested this and both add-ons work again.

I’m a newbie so I’m not sure of the ‘proper’ way to fix this. Do we consume the `_APIKEY` from `aqt.mediasrv` and set our own headers? Or is there any other way? Advice appreciated.

I didn’t post this in the main github issues as i didn’t feel like it merited a thread over there. Hope it’s okay to post this here.

---

<div class="post-metadata">

**Author:** ![glutanimate](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/glutanimate/32/97_2.png) [@glutanimate](https://forums.ankiweb.net/u/glutanimate)\
**Post date:** [April 19, 2025, 3:18pm UTC](https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309/2 "2025-04-19T15:18:51Z")

</div>

Thanks for the report! I filed a [PR](https://github.com/ankitects/anki/pull/3933) to address this, with major credits to @llama for their [previous work](https://github.com/ankitects/anki/pull/3928).

---

<div class="post-metadata">

**Author:** ![babofitos](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@babofitos](https://forums.ankiweb.net/u/babofitos)\
**Post date:** [April 19, 2025, 8:47pm UTC](https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309/3 "2025-04-19T20:47:43Z")

</div>

Thanks for the fix! I guess I was wrong in my assessment ☹ - the api doesn’t matter, just that there was no `onBridgeCmd` being passed for a `DEFAULT` kind because of the if check in `set_kind` thus not giving us access to `pycmd` in the webview.

---

<div class="post-metadata">

**Author:** ![Shigeyuki](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shigeyuki/32/23878_2.png) [@Shigeyuki](https://forums.ankiweb.net/u/Shigeyuki)\
**Post date:** [April 21, 2025, 2:06am UTC](https://forums.ankiweb.net/t/add-ons-and-25-02-1-default-ankiwebview-api-access-workarounds/59309/4 "2025-04-21T02:06:25Z")

</div>

I made and released a small add-on to download the Contanki patch based on your workaround. This is intended as a temporary workaround until Glutanimate’s Pull Request is incorporated into Anki and released, so it will soon be no longer needed. 📥Contanki Patch Downloader for Anki25.02.1 (Fixed by Shigeඞ) [https://ankiweb.net/shared/info/704628562](https://ankiweb.net/shared/info/704628562)
