Closed nivgoldsteiniron closed 3 weeks ago
@nivgoldsteiniron Please host the minimum addin code that we can run to repo in a private repo and share it with @exextoc. This will help us run and root cause the issue.
@nivgoldsteiniron Please host the minimum addin code that we can run to repo in a private repo and share it with @exextoc. This will help us run and root cause the issue.
How should I share it? By private message?
@nivgoldsteiniron Please host the minimum addin code that we can run to repo in a private repo and share it with @exextoc. This will help us run and root cause the issue.
@exextoc I'm publicly hosting the files on an S3 bucket. I'll make sure that they will stay there for the near future. Let me know if you need any other assistance to reproduce. https://ade-plugin-staging.s3.amazonaws.com/ade2/functions.html https://ade-plugin-staging.s3.amazonaws.com/ade2/dialog.html The addin manifest XML should be copy pasted and saved into a local XML file, and be installed manually.
I had a breakthrough in my progress. The popup works when I allow all popups for all websites on chrome, but it doesn't work when I specifically allow popups for: outlook.office365.com outlook.office.com ade-plugin-staging.s3.amazonaws.com outlook.office365.com:443 outlook.office.com:443 ade-plugin-staging.s3.amazonaws.com:443
Is there another domain I need to allow popups for?
I had another breakthrough, it works in the Firefox browser, but not in the Chrome browser when I put the relevant domains in the popup whitelist. Do you have any idea why that might be the case?
@nivgoldsteiniron We are unable to repro the issue on our end. Could you please share a video of the repro, so that we can debug it better?
@nivgoldsteiniron We are unable to repro the issue on our end. Could you please share a video of the repro, so that we can debug it better?
Sure, I've attached a video showing how to install the addin, and a video showing it working as expected in Firefox but not in Edge in the next comment.
Hi @nivgoldsteiniron , thanks for the information! Could you please include the entire domain along with the subdomains as outlined in the following link: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add-ins#open-a-dialog-box-from-a-host-page and try once?
Also, since you mentioned it works in other browsers like Firefox with AppDomains, it seems there might be another extension in Chrome causing interference. Could you try launching the add-in in Chrome's incognito mode to rule out any potential conflicts from other extensions?
Hi @Swathy-Mothilal !
I tried using the Edge browser incognito, but it still doesn't work. However, it does work when I allow all pop-ups for all domains. This isn't a sustainable solution, however.
The URL put in the dialog is "https://ade-plugin-staging.s3.amazonaws.com/ade2/dialog.html", which is an entire domain with subdomains.
@nivgoldsteiniron Can you please share the manifest that you have tried with AppDomains in it? And, make sure you valdiate the manifest using https://learn.microsoft.com/en-us/office/dev/add-ins/testing/troubleshoot-manifest and share the same.
Note: The URL that you have mentioned "https://ade-plugin-staging.s3.amazonaws.com/" is invalid.
@nivgoldsteiniron Can you please share the manifest that you have tried with AppDomains in it? And, make sure you valdiate the manifest using https://learn.microsoft.com/en-us/office/dev/add-ins/testing/troubleshoot-manifest and share the same.
Note: The URL that you have mentioned "https://ade-plugin-staging.s3.amazonaws.com/" is invalid.
Hi @Swathy-Mothilal , the manifest I used is already in the description of the issue (addin.xml).
While the root for https://ade-plugin-staging.s3.amazonaws.com/ is empty, the functions page and dialog page are fully functional: Functions page: https://ade-plugin-staging.s3.amazonaws.com/ade2/functions.html Dialog page: https://ade-plugin-staging.s3.amazonaws.com/ade2/dialog.html
@nivgoldsteiniron, the previous request was to share the manifest file with appDomains listed in the manifest. The manifest in the descriptions does not have appDomains in the list. Also tried adding manifest the set of appDomains you listed in the chat and tried it in firefox browsers, we could not see the dialog page.
Basically, we are facing "access denied" to the appDomain URLs. Secondly, we tried validating the manifest in the manifest validator (https://learn.microsoft.com/en-us/office/dev/add-ins/testing/troubleshoot-manifest) and it throws errors in the URLs shared. Please check it from your end and check the URLs.
@sivachandran-msft hi, I don't really understand what you mean by adding appDomains. Can you give an example?
Hi @nivgoldsteiniron , I mean the manifest is missing the appDomains as mentioned below. I tried adding this to allowlist this but did not work:
@sivachandran-msft
Hi @nivgoldsteiniron , I mean the manifest is missing the appDomains as mentioned below. I tried adding this to allowlist this but did not work:
https://ade-plugin-staging.s3.amazonaws.com/ade2 https://ade-plugin-staging.s3.amazonaws.com/ https://outlook.office365.com/ https://login.microsoftonline.com/ https://login.windows.net/
When I add to the manifest
<AppDomains>
<AppDomain>https://ade-plugin-staging.s3.amazonaws.com</AppDomain>
</AppDomains>
The manifest installation fails. Any idea why?
Hi @nivgoldsteiniron , displayDialog.txt Rename this file to xml and it should work. I just added AppDomains to this. You might have added it at the wrong location. This page mentions when using displayDialog with onSend we should pass displayInIframe as true - https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/outlook-on-send-addins?tabs=modern#user-can-edit-item-while-on-send-add-ins-are-working-on-it . Could you try sending displayInIframe option as true when calling displayDialogAsync and try again? displayInIframe
Edit: It works on Edge for me if I allow popups from - https://outlook.office.com/ So, try this manifest without changing your JS code and it should work.
@neprasad-microsoft
Hi @nivgoldsteiniron , displayDialog.txt Rename this file to xml and it should work. I just added AppDomains to this. You might have added it at the wrong location. This page mentions when using displayDialog with onSend we should pass displayInIframe as true - https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/outlook-on-send-addins?tabs=modern#user-can-edit-item-while-on-send-add-ins-are-working-on-it . Could you try sending displayInIframe option as true when calling displayDialogAsync and try again? displayInIframe
Edit: It works on Edge for me if I allow popups from - https://outlook.office.com/ So, try this manifest without changing your JS code and it should work.
Hi, I just downloaded the file, renamed it to XML, and installed it without changing JS, but the issue persists.
This is how my pop-up settings look like on edge
@neprasad-microsoft
Hi @nivgoldsteiniron , displayDialog.txt Rename this file to xml and it should work. I just added AppDomains to this. You might have added it at the wrong location. This page mentions when using displayDialog with onSend we should pass displayInIframe as true - https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/outlook-on-send-addins?tabs=modern#user-can-edit-item-while-on-send-add-ins-are-working-on-it . Could you try sending displayInIframe option as true when calling displayDialogAsync and try again? displayInIframe
Edit: It works on Edge for me if I allow popups from - https://outlook.office.com/ So, try this manifest without changing your JS code and it should work.
I've tried changing the JS as you suggested, the issue still persists. This is the current functions.html, with displayInIframe: true
<html lang="en">
<head>
<title>No UI</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
<script>
START_TIME = (new Date()).getTime()
const DIALOG_HEIGHT = 60;
const DIALOG_WIDTH = 35;
function getPathUrl(path) {
const url = new URL(window.location.href);
url.pathname = url.pathname.replace("functions.html", path);
url.search = "";
url.hash = "";
return url.href
}
function timedLog(s) {
let total_ms = ((new Date()).getTime() - START_TIME);
console.log(`Timed log (${total_ms}ms) ${s}`);
}
timedLog("Start log");
function handleItemSend(e) {
timedLog("start handleItemSend");
let eventArgs = e;
function processDialogResult(editConfirmed, eventArgs) {
return () => {
eventArgs.completed({allowEvent: !editConfirmed});
}
}
const approveFn = processDialogResult(
false,
eventArgs,
);
const cancelFn = processDialogResult(
true,
eventArgs,
);
function eventHandler(arg, approveFn) {
if (arg.error) {
approveFn();
}
}
function processMessage(arg, approveFn, cancelFn, adeMessage) {
const messageFromDialog = JSON.parse(arg.message);
if (messageFromDialog.result === "isReady") {
dialog.messageChild(
JSON.stringify({adeMessage})
);
} else {
if (messageFromDialog.result === "yes") {
approveFn();
} else {
cancelFn();
}
dialog.close();
Office.context.ui.closeContainer();
}
}
const adeMessage = {
title: "Accidental Data Exposure",
body: "This email contains sensitive information. Are you sure you want to send it?"
};
const dialogUrl = getPathUrl('dialog.html');
timedLog(`Dialog URL ${dialogUrl}`);
Office.context.ui.displayDialogAsync(
dialogUrl,
{
height: DIALOG_HEIGHT,
width: DIALOG_WIDTH,
promptBeforeOpen: false,
displayInIframe: true,
},
function (asyncResult) {
timedLog(`asyncResult start ${asyncResult.status}`);
// In case if dialog not opened by error (blocked popup) we are approving sending
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
eventArgs.completed({allowEvent: true});
}
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg) => processMessage(arg, approveFn, cancelFn, adeMessage));
dialog.addEventHandler(Office.EventType.DialogEventReceived, (arg) => eventHandler(arg, approveFn));
timedLog(`asyncResult end`);
}
);
}
Office.initialize = function () {
}
timedLog("Finish loading definitions");
</script>
</head>
<body>
This page is left blank intentionally.
</body>
</html>
Hi @nivgoldsteiniron I am using your original manifest and trying with these settings on Edge:
This is the mailbox setting applied -
As you can see, I see the popup:
Can you try with a different account/tenant? Also, please share your HAR files and console log with us following these steps -https://github.com/OfficeDev/office-js/wiki/Collecting-log-files-for-Outlook-Add%E2%80%90ins-issues
Thanks @neprasad-microsoft ! It worked. It requires me to close the browser for it to work.
Thanks for the acknowledgement @nivgoldsteiniron :). I am closing this issue. Please open a new issue if you find any other problem.
@neprasad-microsoft Thank you!
Provide required information needed to triage your issue
In the callback for ItemSend I run displayDialogAsync to display a dialog to the user to notify them there is suspicious content in the email and ask them if they want to send the email. (In reality, it accesses a backend. But in the example I provided it will always show the dialog) We can see the dialog when OnSendAddinsEnabled is false, but when its true, the dialog can't be seen.
Your Environment
Expected behavior
The dialog popup should also to be shown when OnSendAddinsEnabled is true. Currently, I only see it dialog when OnSendAddinsEnabled is false.
Steps to reproduce
addin.xml
functions file simplified to not interact with BE to focus on the issue at hand: https://ade-plugin-staging.s3.amazonaws.com/ade2/functions.html
https://ade-plugin-staging.s3.amazonaws.com/ade2/dialog.html
Context
This breaks the feature, customers can't see the dialog