OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
687 stars 94 forks source link

Redirection in PowerPoint task pane desktop from one application to another application #4815

Open shivAtSap opened 2 months ago

shivAtSap commented 2 months ago

We have an add-in. After loading the add-in, user is supposed to login. For the login workflow we open a dialog in which the user inputs his credential and after successful validation the dialog is supposed to redirect to the task pane but unfortunately this redirection is not happening. The dialog redirects to a new default browser window from the PowerPoint desktop.

Your Environment

Expected behavior

After successfully logging in the dialog should redirect to the task pane which is happening in web but doesn't happen in PowerPoint desktop

Current behavior

In PowerPoint desktop, after successfully logging or on successful validation of user credentials the dialog redirects to a new default browser

Steps to reproduce

Step 1: We have created 2 task pane sample applications using command “yo office” , and then we execute a script ("start:desktop": "office-addin-debugging start manifest.xml desktop") for 2nd application. Now the 2nd sample task pane project has opened in PowerPoint desktop mode Step 2: We close the 2nd application that we recently opened using the above script. Step 3: We manually upload the manifest for the first sample task pane project and now we create a button in the same , which on click opens a dialog and the user needs to input his credentials and after successful validation, it allows us to redirect to the second sample task pane project. But in our case when we click on the button it opens in a new browser window. The same steps when we performed in another laptop, but this time we didn’t execute the script ("start:desktop": "office-addin-debugging start manifest.xml desktop") for the second application. We directly uploaded the manifest and tried to redirect to the second sample task pane project from the dialog and it worked. The problem we are facing now is in whichever system where we have already run the script("start:desktop": "office-addin-debugging start manifest.xml desktop") once, we are not able to redirect to our second application as it opens in a new browser from desktop mode, but it works perfectly fine in the systems where we have not executed the script and also in PowerPoint web.

Context

This issue has stopped us from any development or testing our add-in in the PowerPoint desktop mode in the systems where we have run the script.

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

EsterBergen commented 2 months ago

hi @shivAtSap - Thanks for reaching out on this question. Can you help me understand- are you trying to go back to the original task pane in this scenario that launched the dialog or are you trying to communicate with a second/different add-in?

Currently it's only possible to communicate with the task pane from which the dialog was launched.

Please let us know.

shivAtSap commented 2 months ago

Hi @EsterBergen , We are trying to go back to the original task pane that launched the dialog but it does not happen in this scenario, but in some other cases that I have mentioned above, its working fine.

EsterBergen commented 2 months ago

Hi @shivAtSap - Thank you for confirming that you're trying to go back to the original task pane that launched the dialog. I was confused because you say "Step 3: We manually upload the manifest for the first sample task pane project and now we create a button in the same , which on click opens a dialog and the user needs to input his credentials and after successful validation, it allows us to redirect to the second sample task pane project."- Do you mean that you redirect to the first sample task pane project?

shivAtSap commented 2 months ago

Hi @EsterBergen , We have 2 applications(2 diff repos) for a add-in. First one is the landing page application. Once we click on the button in the landing page it opens up a dialog box after which when we enter our credentials, and then we close the dialog and redirect to our second application in the same task pane which is working fine for some of the users . While for some users we notice that some of them who didn't run the script as well are facing this issue.