Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Feat: migrate local data via postMessage (#4017)
Browse files Browse the repository at this point in the history
* Feat: migrate local data via postMessage

* Rm test domains
  • Loading branch information
katspaugh authored Jul 19, 2022
1 parent f9d935e commit bd6ea8b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions public/migrate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<script>
;(function () {
const allowedOrigins = [
'https://web-core.pages.dev',
'https://beta.safe.global',
'https://app.safe.global',
]
// Send the entire localStorage if the origin is allowed
window.addEventListener('message', function (event) {
if (allowedOrigins.includes(event.origin)) {
event.source.postMessage(
{
type: 'migration-data',
payload: JSON.parse(JSON.stringify(localStorage)),
},
event.origin
)
}
})
})()
</script>

0 comments on commit bd6ea8b

Please sign in to comment.