Fix inline script in field input#12
Open
tpilewicz wants to merge 2 commits into
Open
Conversation
Author
|
@triaeiou would you mind taking a look? I know the fix is hacky but it would allow running the add-on on Anki v25 :) Also FYI here's how I tested it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
The idea is that we can't run an inline script anymore because the CSP forbids it. So I moved the code of the inline script to a separate
init_configfile. The CSP allows running any script that is located in the addons folder.It's a bit hacky though, in the sense that the type checker won't understand where
MarkdownInputcomes from 😄I noticed other inline scripts (in
window_input.py) that will probably be broken by Anki's CSP. But I don't know when they're used, so I don't know how to test a fix, so I prefer not to touch it until I know how it's used.