Page MenuHomePhabricator

Share localStorage between multiple domains with iframe's and postMessage()
Open, Needs TriagePublic

Description

We have issues generating metrics for interwiki search because the session information is in local storage, and local storage is per domain (not even per TLD).

It is possible to work around this by embedding an iframe in pages and using Window.postMessage to send data from the parent to the iframe and back. All wikimedia sites would need to use the same domain for the iframe (centralauthwiki ? i dunno...).

Needs careful consideration of security, to prevent other domains accessing the "globalStorage". Likely this can be done with a list of TLD's to accept. The resulting API should look like mw.storage, but returns promises instead of values directly.

Event Timeline

EBernhardson raised the priority of this task from to Needs Triage.
EBernhardson updated the task description. (Show Details)
EBernhardson added a project: CirrusSearch.
EBernhardson added subscribers: EBernhardson, Krinkle.
Restricted Application added a project: Discovery. · View Herald TranscriptFeb 16 2016, 12:50 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript