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

Outlook client add-ins: links and JS redirects to other domain, open a new browser tab #917

Closed
hello-chenchen opened this issue Dec 27, 2019 · 16 comments
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Resolution: question answered Question is answered by engineering team.

Comments

@hello-chenchen
Copy link

hello-chenchen commented Dec 27, 2019

Only happen on Window 10 1903 Verison!!!
Window 10 1903 Verison OS build: 18362.535

Outlook client: Verison 1911 (Build 12228.20364 Click-to-Run) MSO (16.0.12228.20322) 64Bit.

My site is domaina.com. when i execute this code on Microsoft Edge DevTools Preview:

location.href = domainb.com/xxx/xxx

it can't redirect to the domainb.com on the right site add-on panel, it open my default browser to load my links.

I have add domainb.com to my manifest like this one:

<AppDomain>https://domainb.com</AppDomain>

this works for mac, and windows 10 1803, 1703. But not worked for 1903.
I notice that, the win10 1903 use edge browser engine instead of ie11 engine to work for outlook client add-ins. Is it the root cause?

please take a look. thanks~

@ghost ghost added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Dec 27, 2019
@lindalu-MSFT lindalu-MSFT added Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Dec 27, 2019
@lindalu-MSFT
Copy link
Contributor

Hi @hello-chenchen Thanks for bringing this to our attention. I've assigned this issue to the Outlook Add-ins Team for follow-up. Due to the holidays, it might be a few days before you hear back from them! Cheers, lindalu

@hello-chenchen
Copy link
Author

hi @lindalu-MSFT , thanks for your reply.
Have fun, chen.

@hello-chenchen
Copy link
Author

hi @lindalu-MSFT @exextoc , Any info you can pass would be appreciated.

@hello-chenchen
Copy link
Author

hi @jargil , do you have any suggestion?
thanks~

@hello-chenchen
Copy link
Author

when i execute code like below:

var displayUrl = "https://domainb.com";
Office.context.ui.displayDialogAsync(displayUrl, { height: 75, width: 40 }, function(result) {
    console.log('displayDialogAsync: ');
    console.log(result);
});

The Edge DevTools will console log an error result like below:

[object Object]: {error: Object, status: "failed", value: undefined}

error: Object
code: 12004
message: "The domain of the URL is not included in the AppDomains element in the manifest, and is not subdomain of source location."
name: "Display Dialog Error"

__proto__: Object
status: "failed"
value: undefined

__proto__: Object

But in fact,
I have add domainb.com to my manifest:

<AppDomains>
<AppDomain>https://domainb.com</AppDomain>
<AppDomains>

But it is useless for

Window 10 1903 Verison OS build: 18362.535
Outlook client: Verison 1911 (Build 12228.20364 Click-to-Run) MSO (16.0.12228.20322) 64Bit.

@lindalu-MSFT
Copy link
Contributor

@hello-chenchen You might also try asking this question to the Outlook developer community on Stack Overflow. Use the tags [office-js] and [outlook-web-addins]. I did a search on AppDomains and found a few questions that might have the answer, or you can ask a new question. Let me know if you find out anything!

@jargil
Copy link

jargil commented Jan 11, 2020

@hello-chenchen - could you please share your manifest and if possible the full snippet of the code where you call the dialog API?

@hello-chenchen
Copy link
Author

hi @jargil ,
this below is the briefly version for manifest xml.

<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp 
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" 
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" 
xsi:type="MailApp">

  <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->

  <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
  <Id>AF0325AB-6C61-4746-8414-781078F0EFF6</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.4.0.0</Version>
  <ProviderName>Zoom Video Communications, Inc</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
  <DisplayName DefaultValue="Zoom" />
  <Description DefaultValue="Zoom Schedule Add-in" />
  <IconUrl DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/icon-128.png" />
  <SupportUrl DefaultValue="https://support.zoom.us/" />

  <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
  <AppDomains>
    <AppDomain>zoom.us</AppDomain>
    <AppDomain>*.zoom.us</AppDomain>
    <AppDomain>https://zoomgov.com</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->

  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://zoom.us/office365/schedule" />
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions> 
  <Rule xsi:type="RuleCollection" Mode="Or">
  <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
  <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Requirements>
        <bt:Sets DefaultMinVersion="1.3">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
          <FunctionFile resid="functionFile" />
          <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="msgReadGroup">
                <Label resid="groupLabel" />
                <Control xsi:type="Button" id="addZoomButton">
                  <Label resid="addZoomButtonLabel" />
                  <Tooltip resid="addZoomButtonTooltip" />
                  <Supertip>
                    <Title resid="addZoomButtonTipTitle" />
                    <Description resid="addZoomButtonTipDescription" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="addzoom16" />
                    <bt:Image size="32" resid="addzoom32" />
                    <bt:Image size="80" resid="addzoom80" />
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>oneclickPrepareMeeting</FunctionName>
                  </Action>
                </Control>
                    <!-- Task pane button -->
                    <Control xsi:type="Button" id="msgReadOpenPaneButton">
                      <Label resid="paneReadButtonLabel" />
                      <Supertip>
                        <Title resid="paneReadSuperTipTitle" />
                        <Description resid="paneReadSuperTipDescription" />
                      </Supertip>
                      <Icon>
                        <bt:Image size="16" resid="settings16" />
                        <bt:Image size="32" resid="settings32" />
                        <bt:Image size="80" resid="settings80" />
                      </Icon>
                      <Action xsi:type="ShowTaskpane">
                        <SourceLocation resid="messageReadTaskPaneUrl" />
                      </Action>
                    </Control>
                  </Group>
                </OfficeTab>
              </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="addzoom16" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/addzoom-16.png" />
        <bt:Image id="addzoom32" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/addzoom-32.png" />
        <bt:Image id="addzoom80" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/addzoom-80.png" />
        <bt:Image id="settings16" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/settings-16.png" />
        <bt:Image id="settings32" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/settings-32.png" />
        <bt:Image id="settings80" DefaultValue="https://d24cgw3uvb9a9h.cloudfront.net/assets/settings-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://zoom.us/office365/schedule" />
        <bt:Url id="functionFile" DefaultValue="https://zoom.us/office365/addzoom" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Zoom" />
        <bt:String id="customTabLabel" DefaultValue="Zoom" />
        <bt:String id="paneReadButtonLabel" DefaultValue="Settings" />
        <bt:String id="paneReadSuperTipTitle" DefaultValue="Meeting Settings" />
        <bt:String id="addZoomButtonLabel" DefaultValue="Add a Zoom Meeting" />
        <bt:String id="addZoomButtonTipTitle" DefaultValue="Schedule Zoom Meeting" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="paneReadSuperTipDescription" DefaultValue="Meeting Settings" />
        <bt:String id="addZoomButtonTipDescription" DefaultValue="Schedule Zoom Meeting" />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

And the full snippet of the code is:

var displayUrl = "https://zoomgov.com/office365/login";
Office.context.ui.displayDialogAsync(displayUrl, { height: 75, width: 40 }, function(result) {
    console.log('displayDialogAsync: ');
    console.log(result);
});

execute the above code in Edge Devtools on:

Window 10 1903 Verison OS build: 18362.535
Outlook client: Verison 1911 (Build 12228.20364 Click-to-Run) MSO (16.0.12228.20322) 64Bit.

you can repro this bug.

As i have said that, this above code worked for mac, win10 1803, 1703, but for win10 1903 and Outlook client: Verison 1911 which use edge browser engine is not work

@hello-chenchen
Copy link
Author

hi @lindalu-MSFT , thank you for your suggestion.
i will search more careful on stackoverflow again.
thanks a lot.

@exextoc exextoc removed their assignment Jan 13, 2020
@jargil
Copy link

jargil commented Jan 15, 2020

*.zoom.us is an invalid entry in your manifest.
Wildcards are not supported and I'm actually surprised if this actually worked on Mac or other builds of Windows. Most likely the next line is not getting parsed. Try removing that entry in your manifest and try again. Let me know, if that doesn't fix your problem then I'll try to repro locally.

@hello-chenchen
Copy link
Author

hi @jargil ,
i removed *.zoom.us, But it seems that the same behavior.
Please try to repro on your site, appreciated that. thank you so much.

@hello-chenchen
Copy link
Author

image

Bug version.

@hello-chenchen
Copy link
Author

hi @jargil ,
for repro this bug, please execute the snippet code on the task pane which tag is messageReadTaskPaneUrl

@hello-chenchen
Copy link
Author

@jargil
Copy link

jargil commented Jan 17, 2020

@hello-chenchen - sorry for the delay.
The problem is with the way you specified your AppDoimains.

Today you have this:

  <AppDomains>
    <AppDomain>zoom.us</AppDomain>
    <AppDomain>*.zoom.us</AppDomain>
    <AppDomain>https://zoomgov.com</AppDomain>
  </AppDomains>

Your first two entries are invalid:

  • You have to specify protocol.
  • You cannot use wildcards.

Please fix it to something like this:

  <AppDomains>
    <AppDomain>https://zoom.us</AppDomain>
    <AppDomain>https://zoomgov.com</AppDomain>
  </AppDomains>

image

You should see the dialog popping up. Let me know if you were able to get it working.

Same exact thing applies to Mac, Office Online and any other Windows build.

@jargil jargil added Needs: author feedback Waiting for author (creator) of Issue to provide more info Resolution: question answered Question is answered by engineering team. and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Jan 17, 2020
@hello-chenchen
Copy link
Author

hi @jargil ,
Got it. thank you so much for your help.
On the last few days, i just remove

<AppDomain>*.zoom.us</AppDomain>

, But not change

<AppDomain>zoom.us</AppDomain>

to

<AppDomain>https://zoom.us</AppDomain>

I appreciated for your help again.
have a good day.

@ghost ghost 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 Jan 19, 2020
@jargil jargil removed the Needs: attention 👋 Waiting on Microsoft to provide feedback label Jan 24, 2020
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: question answered Question is answered by engineering team.
Projects
None yet
Development

No branches or pull requests

4 participants