Search code examples
office365office-jsoffice365-appsydn-db

WebSQL unsupported in Office for Mac client enviornment


We are using indexedDB/WebSQL to store data locally in our Excel Task-pane add-in. While this works on all other environments, we are seeing it fail in Office for Mac client. While vorlon.js shows that WebSQL is supported when running inside the taskpane, actual call to open a websql DB fails with "DOM Exception 18"

stack:

openDatabase@[native code] connect@http://localhost:8081/ydn.db-dev.js?v=1:307:334 Ff@http://localhost:8081/ydn.db-dev.js?v=1:180:132 A@http://localhost:8081/ydn.db-dev.js?v=1:177:384 Re@http://localhost:8081/ydn.db-dev.js?v=1:177:13 Mg@http://localhost:8081/ydn.db-dev.js?v=1:188:345 X@http://localhost:8081/ydn.db-dev.js?v=1:191:82 cj@http://localhost:8081/ydn.db-dev.js?v=1:333:405 global code@http://localhost:8081/todo.js:17:28

You can find the simple add-in we used for testing here: https://1drv.ms/u/s!AuIKF3TQj25mrxzPbJSPSaRVqNDg

Is there a way to enable WebSQL support in Office for Mac client?


Solution

  • Probably, Office add-in use web worker environment. In this case, Safari does not support neither indexedDB or WebSQL at the moment.

    From Safari 9 release note, indexedDB support in Web worker is coming.

    If there is not database support, I guess there is not workaround.