title: Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js
body: <p>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:</p>
  <p><a href="https://i.stack.imgur.com/JwmHx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JwmHx.png" alt="tracking settings for MS Edge" /></a></p>
  <p>I gave javascript permission to appsforoffice.microsoft.com since devtools is saying it's blocking this this file specifically <a href="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" rel="noreferrer">https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js</a> 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.</p>
  <p>I read the article found here <a href="https://docs.microsoft.com/en-us/microsoft-edge/web-platform/tracking-prevention" rel="noreferrer">https://docs.microsoft.com/en-us/microsoft-edge/web-platform/tracking-prevention</a> 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.</p>
  <p>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.</p>
  <p>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.</p>
  <p>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?</p>
  <p>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 <code>previewString</code> that I store in sessionStorage so a Dialog window can open and read <code>previewString</code> 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:</p>
  <p><a href="https://i.stack.imgur.com/XJ4eO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XJ4eO.png" alt="sessionStorage" /></a></p>
  <p>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 <a href="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" rel="noreferrer">https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js</a> as well as a Permission Denied error.</p>
  <p><a href="https://i.stack.imgur.com/UY4pO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UY4pO.png" alt="enter image description here" /></a></p>
  <p><code>previewString</code> is not available in the sessionStorage tab for this dialog</p>
  <p><a href="https://i.stack.imgur.com/KVZje.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KVZje.png" alt="enter image description here" /></a></p>
  <p>SECOND EDIT: I searched the error code the console was giving <code>OSF.DDA.ERROR code 7000, permission denied</code> and found this post on SO <a href="https://stackoverflow.com/questions/35810297/office-js-api-permission-denied-issue">Office JS Api - Permission Denied Issue</a>. This appears to have been a bug in the past, but I'm not sure if this is the case again or not.</p>