Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigator.storage (OPFS) access #4137

Closed
chfaft opened this issue Feb 14, 2024 · 7 comments
Closed

Navigator.storage (OPFS) access #4137

chfaft opened this issue Feb 14, 2024 · 7 comments
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Resolution: external Issue isn't related to the Office Add-ins platform, Office JavaScript APIs, or documentation

Comments

@chfaft
Copy link

chfaft commented Feb 14, 2024

We are about to create an Outlook Add-In that should be able to encrypt large files before uploading and optionally be able to decrypt them after downloading. The technology in charge is Navigator.storage (OPFS) which allows to save files on the local filesystem which allows us to use the local harddrive as intermediate memory before and after the encryption/decryption. As the JavaScript engine in Outlook runs in a sandbox, we have not found a way so far to do this operation in the Outlook and web context.

Do you see any chance to use this feature in another way or does any plan exist to intercept uploads and downloads for AddIns?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Feb 14, 2024
@exextoc exextoc added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Outlook Issue related to Outlook add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Feb 14, 2024
@exextoc exextoc self-assigned this Feb 14, 2024
@ajays-msft
Copy link

@chfaft - If I understand correctly, you need an office-js event to know before an attachment is uploaded, and after attachment is uploaded. Is that right?

@ajays-msft ajays-msft added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 18, 2024
@chfaft
Copy link
Author

chfaft commented Feb 19, 2024

Hi @ajays-msft - Thanks for your reply. We actually need to modify the content of files before the upload and after the download. The files can theoretically be much bigger than the memory of the user. Therefore we currently use OPFS to save them temporary, which seems to be not available in the Outlook-JS-Sandbox. This process happens completely independend of the Outlook attachments, so it does not have anything to do with Outlook attachments events. The problem so far is that we get a code snippet like this not running:

navigator.storage.getDirectory().then((directory) => { console.log("Directory", directory) }).catch((e) => { console.error("Navigator Storage Error: ", e) })

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Feb 19, 2024
@ajays-msft
Copy link

@chfaft - Will it help if you have an event before attachment is added, and in the event office-js gives a link to file, you then upload the file to the server, encrypt there and add it back to the email?
Similar approach you could potentially have for downloads.

This is not a feature we have currently, but I want to understand if that will help you.

@ajays-msft ajays-msft added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 19, 2024
@chfaft
Copy link
Author

chfaft commented Feb 19, 2024

@ajays-msft - Thanks for your message! Your suggestion would simplify things, but we really need to have this action done on client side for security reasons. Encryption on server side is unfortunately no option in this case.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Feb 19, 2024
@zhngx1
Copy link

zhngx1 commented Mar 13, 2024

@chfaft Are you having issue with windows Outlook client or Outlook web? What is the error you see for your code snippet with the navigator.storage?

@chfaft
Copy link
Author

chfaft commented Mar 13, 2024

@zhngx1 It turned out that the File API is a possible approach to deal with this issue, as it allows the interception of file uploads in the way we would need. We have not done our tests with really big files yet, but as for now this way seems to be a suitable approach for our needs.

@ajays-msft
Copy link

This forum is limited to supporting office-js apis. Since this is out of scope of office js, closing it.

@ajays-msft ajays-msft added Resolution: external Issue isn't related to the Office Add-ins platform, Office JavaScript APIs, or documentation and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Resolution: external Issue isn't related to the Office Add-ins platform, Office JavaScript APIs, or documentation
Projects
None yet
Development

No branches or pull requests

4 participants