I wrote an Excel add-in using the OfficeJS API about a year and a half ago and it has been working until about two weeks ago. It seems like Excel has had an update where I'm now allowed to right click on the taskpane and see dev tools, where I wasn't able to do that before and had to run an external MS Edge devtools application for debugging. This seems like a relatively new issue and I can't seem to find any information about it. I tried reducing MS Edge's Tracking prevention settings to the Basic setting as seen below:
I gave javascript permission to appsforoffice.microsoft.com since devtools is saying it's blocking this this file specifically https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js in the console. I also included just microsoft.com as well as the company's URL and cdn url. I also added localhost since this is happening locally on my computer too. I can't seem to change any blocking settings in Excel specifically, but my assumption is that excel runs an instance of Edge for the add-in since I can track it in Edge devtools.
I read the article found here https://learn.microsoft.com/en-us/microsoft-edge/web-platform/tracking-prevention in order to see what I could change, but none of the solutions here worked for me. It almost seems like the settings for Edge aren't getting read into Excel so it always blocks any application that attmeps to read from localStorage/sessionStorage.
I use sessionStorage in my add-in to write data to to read back out and tried localStorage too, but I still get the same error.
Even stranger, the data I'm attempting to read out is from data I've written to the storage and can see that it's been written with no problem when I look at the storage tab in devtools so the problem is limited to just reading from the storage.
Does anyone know where the changes to the tracking needs to be made for Excel add-ins to be able to read from the storage if these changes don't get updated from MS Edge or if there is a new bug that was released with Excel recently?
EDIT: To be more clear about the exact issue, my add in basically reads text and values from the cells and based on tags I've defined for the users, these values will be output in an HTML element containing the tags the user wants to generate. For example, when a user wants a paragraph, they can mark a cells with /para and /end para and any text and values in the rows/cells between that will be output in an HTML paragraph tag. They can also build out HTML tables like this. During the process of reading in the text and values, this all gets built out into a string called previewString
that I store in sessionStorage so a Dialog window can open and read previewString
from sessionStorage and will be the completed HTML the user wants to generate. All of this has been working now for about a year and a half, but now when attempting to generate the HTML, I can see the string is stored in sessionStorage as shown in the screen shot below:
However, when the dialog window opens, the data is not in the sessionStorage so it can't be read and it still has the error Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js as well as a Permission Denied error.
previewString
is not available in the sessionStorage tab for this dialog
SECOND EDIT: I searched the error code the console was giving OSF.DDA.ERROR code 7000, permission denied
and found this post on SO Office JS Api - Permission Denied Issue. This appears to have been a bug in the past, but I'm not sure if this is the case again or not.