mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
LibWeb: Initialize the Storage byte count upon creation
A Storage object may be created with an existing storage bottle. For example, if you navigate from site.com/page1 to site.com/page2, they will have different localStorage objects, but will use the same bottle for actual storage. Previously, if page1 set some key/value item, we would initialize the byte count to 0 on page2 despite having a non-empty bottle. Thus, if page2 set a smaller value with the same key, we would overflow the computed byte count, and all subsequent writes would be rejected. This was seen navigating from the chess.com home page to the daily puzzle page.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
31da70bbfc
commit
4dfc29356d
Notes:
github-actions[bot]
2025-03-18 19:35:13 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/4dfc29356d2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3990 Reviewed-by: https://github.com/gmta ✅
4
Tests/LibWeb/Text/data/local-storage-iframe.html
Normal file
4
Tests/LibWeb/Text/data/local-storage-iframe.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<script>
|
||||
localStorage.setItem("foo", "barbaz");
|
||||
parent.postMessage("local storage set", "*");
|
||||
</script>
|
||||
Reference in New Issue
Block a user