首页 > 解决方案 > 在 office word add in 中使用 openBrowserWindow 时,localstorage 不起作用

问题描述

我有一个词添加角度。我正在使用 openBrowserWindow 打开一个带有 html 文件的新窗口。Office.context.ui.openBrowserWindow("http://someurl/hello.html");

我在应用程序的 localstorage 中设置了一些值,但是当我尝试从使用 html 文件打开的新窗口中获取时,localstorage 值为 null。

笔记:

  1. 我可以在应用程序中访问 localstorage 值,但不能在新窗口中访问
  2. 应用程序和html在同一个域中

这在内部使用边缘。

标签: local-storageoffice-jsoffice-addinsword-addins

解决方案


推荐阅读