Skip to content

How to determine whether the current connection is secure #4236

Closed Answered by falkoschindler
weinibuliu asked this question in Q&A
Discussion options

You must be logged in to vote

Good question, @weinibuliu! Maybe it would be better to raise an exception instead of printing a warning and returning an empty string. But because it would break the API, we would need to wait for version 3.0 before changing it.

Your custom read() function seems like a good workaround. You can use it without modifying the library. This way you don't have to wait for 3.0.

To check whether the clipboard is available, you can use a function like this:

async def can_access_clipboard() -> bool:
    return await ui.run_javascript('navigator.clipboard') is not None

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@weinibuliu
Comment options

@falkoschindler
Comment options

Answer selected by weinibuliu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants