Open repl-minatee-p opened 1 year ago
Thank you for letting us know about this issue. We will take a look shortly. Thanks.
Hi @jargil could you please take a look this issue?
Hello @penglongzhaochina ! I am encountering the same issue. I was going to open a new issue, but found that this one already addresses the same problem. Could you please update me if there are any updates on this matter? Thank you!
It appears that Office apps might isolate add-ins per application (and do not utilize GroupContainers unlike some other features). This particular distinction from Windows is not documented, and it would be really great if Mac apps allow an add-in to share localStorage/indexedDB across different hosts, given that the add-in ID and origin remain consistent, as we are using the same manifest.xml.
@msftbot @penglongzhaochina I have the same issue on Excel for Mac. The problem does not occur for me on Windows.
Hi all,
Could you please check whether the local storage key which the add-in want to get are really there? If the local storage key really are there you can paste the error message which the API can't get the local storage content to here. It would be very helpful,Thanks!
Hi @penglongzhaochina,
No, when I check the storage key in a different host application, it is not present (for example, a key set in Excel does not appear when checked in Word). There is no error message; in both applications, localStorage (as well as other browser APIs like indexedDB) functions correctly, but they operate independently, unlike on Windows.
Can below link give you some insights? This issue may be similar with your scenario. Could you please go through this link to check whether your issue is related with this issue. having a workaround there.
@penglongzhaochina, thanks, but the issue discussed in the issue you provided a link for is about the Dialog API and online platform (and thus the storage partitioning applies). The issue reported by @repl-minatee-p (we also observe) only relates to the Office for Mac - Office for Windows apps do not separate storage for the same add-in running in different apps.
Hi all,
This is a by-design behavior on mac.
Hi @penglongzhaochina,
1) Is the behavior observed on Windows hosts indicative of a bug? I am uncertain as to why there is a need for separate storage when the add-in is identical. However, if this is a security-related issue, I would appreciate guidance on whether to report this as a problem for the Windows application and as a documentation issue. Specifically, the section titled 'Persist add-in state and settings' suggests that localStorage can be utilized to maintain the state of the add-in.
2) Additionally, there is OfficeRuntime.Storage
interface. The documentation indicates that this should be accessible across different hosts (and even different add-ins from the same domain), with a storage limit of 10 MB per domain, potentially shared by multiple add-ins. According to the documentation, this interface is expected to provide consistent values for an add-in from the same domain. However, on Mac, this is not the case.
Hi @jargil ,
could you please help explain this issue?
I just found this issue seems to be related: https://github.com/OfficeDev/office-js/issues/2928 (and covers OfficeRuntime.Storage).
I have defined the Word, Excel and PowerPoint add-ins in one manifest.xml file. I am using localStorage to share data between these Word, Excel and PowerPoint add-ins. It works fine in Windows but not in Mac. In Mac, the data are shared between the same app add-ins but not across the apps add-ins. For example, if I store data in the localStorage of word add-in then it gets shared with all other word add-ins but not with excel and powerpoint add-ins.
Your Environment
Expected behavior
I expect localStorage.getItem(key) in Excel and PowerPoint add-ins should get the value set in Word add-in using localStorage.setItem(key, value) and vice versa. It works fine in Windows but not in Mac.
Current behavior
Word add-in localStorage data are not shared with Excel and PowerPoint add-ins and vice versa.
Context
My add-in customers need data to be shared between Word, Excel and PowerPoint add-ins.