Closed gabriel-maxx closed 2 years ago
Actually, it isn't possible as Microsoft Office (their website) cannot work offline 😢
Actually, it isn't possible as Microsoft Office (their website) cannot work offline 😢
OK thank you for answering
Hello there,
I'm studying the possibility of making Office Online work offline, here are my notes :
The most important Office Online URL seems to be https://onedrive.live.com/edit.aspx?resid=<ResourceId>
, which first body
element is a script
containing, among other things, the following data :
{
"WacApplication": "",
"PageTitle": "",
"WacBootstrapperUrl": "",
"HostName": "OneDrive",
"HostSessionId": "",
"UserId": "",
"OwnerId": "",
"ApplicationUrl": "",
"ResourceId": "",
"ETag": "",
"FileName": "",
"FileGetUrl": "",
"FileGetUrlExpiry": 0,
"FileSize": 0,
"ReadOnly": 0,
"ViewOnly": 0,
"AppEnabled": 1,
"WopiSrc": "https://wopi.onedrive.com/wopi/files/<ResourceId>",
"AccessToken": "",
"AccessTokenExpiry": 0,
"HostFlights": {}
}
Where :
ApplicationUrl
's domain is word-edit.officeapps.live.com
for docs, powerpoint.officeapps.live.com
for slideshows, etc. ;FileGetUrl
is the direct link to the file ;Using Electron's interceptBufferProtocol
method, it is possible to make any request fired from any Electron-wrapped webapp reply whatever we want, including the abovementioned data, e.g. to make Office Online open offline resources.
I've made this work once with a much simpler MS App, that is the Graph Explorer, but I think it could also be done here.
Additionally, the ApplicationUrl
value is used to spawn an iframe
at onedrive.live.com
, which parameters look related to something called the WOPI prototocol, allowing Microsoft & partners to embed Office Online into a parent app (in this case, OneDrive).
Instead of wrapping onedrive.live.com
, maybe that value URL itself could be wrapped, leveraging said protocol.
hello, I would like to know if there is any trick to make it work offline even if I have to download some additional stuff...