Skip to content

localStorage is shared between ZIM files #127

@Markus-Rost

Description

@Markus-Rost

I noticed this while working on openzim/mwoffliner#2483, which like MediaWiki itself uses the local storage to cache JavaScript modules for faster load times. This resulted in me loading JavaScript from different ZIM files of the same wiki and for some wikis even JS from a completely different wiki.

Image

For the PR I solved this issue by adding a timestamp to the vary version check when loading from localStorage, but ultimately this seems like an issue that should be solved by the reader as getting unexpected data in localStorage from different ZIMs might cause all kinds of issues. The reader should probably clear the localStorage whenever a new ZIM file is getting loaded.

I did not test if this issue exists for other types of storage as well (session, cookies) and I didn't test it for other readers either. I would appreciate it if you could create follow-up issues for any other readers affected by this issue as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions