Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Oct 26, 2024

Describe your changes

The local storage in an Android WebView is only available when accessed via window.localStorage and not localStorage directly (see here). This PR makes sure that window.localStorage is used everywhere.

This also adds a lint rule to prevent the usage of localStorage.

GitHub Issue Link (if applicable)

Testing Plan

  • No logical changes and we cannot test usage of Android WebView easily.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Oct 26, 2024
@lukasmasuch lukasmasuch marked this pull request as ready for review October 26, 2024 19:10
@lukasmasuch lukasmasuch mentioned this pull request Oct 26, 2024
4 tasks
@lukasmasuch lukasmasuch merged commit dde5b21 into develop Oct 29, 2024
@lukasmasuch lukasmasuch deleted the fix/issue-with-local-storage branch October 29, 2024 04:26
edegp pushed a commit to edegp/streamlit that referenced this pull request Jan 19, 2025
## Describe your changes

The local storage in an Android WebView is only available when accessed
via `window.localStorage` and not `localStorage` directly (see
[here](https://stackoverflow.com/questions/5822256/error-web-console-uncaught-typeerror-cannot-call-method-getitem-of-null-at-h)).
This PR makes sure that `window.localStorage` is used everywhere.

This also adds a lint rule to prevent the usage of localStorage.

## GitHub Issue Link (if applicable)

- Closes: streamlit#9740

## Testing Plan

- No logical changes and we cannot test usage of Android WebView easily.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android Webview Error: 2ST

3 participants