Make the add-on and its browser popup with the same local storage?
I am creating an Excel add-in with JavaScript API.
The add-on can pop up in the browser window using
popup = window.open("https://localhost:3000/#/new", "popup", "status=1, location=1, width=1000, height=1200");
I have tested that the add-on and browser popup can communicate postMessage
.
However, it looks like they are NOT using the same localStorage
. For example, if I install localStorage.setItem("item", "content")
on a web page, localStorage.getItem("item")
the add-in will return null
.
Does anyone know if the add-on and browser popup support the same localStorage?
PS: I tested that the add-in can set an element to localStorage
and get a value. In addition, web pages can install and receive items in localStorage
, even though they can be in the same browser window.
source to share