我在让 webview 为我为 Outlook 构建的上下文加载项工作时遇到问题

I'm having issues getting the webview working for a contextual add-in I'm building for Outlook

加载项应使用正则表达式匹配检测并突出显示特定的 URL(它会执行此部分),当用户单击检测到的区域时,应弹出 webview 并显示来自link。但它并没有做 that.It 总是说出了点问题,我们无法启动此加载项。

这是我的代码:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<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">
  <Id>02d1356d-95ba-466a-9eb8-91e37dac827e</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Outlook add-In"/>
  <Description DefaultValue="A Outlook add-in."/>
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://www.contoso.com/help"/>
  <AppDomains>
    <AppDomain>https://www.contoso.com</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1"/>
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://localhost:3000/src/taskpane/index.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="And">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
    <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL" RegExValue="https://google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
                
    <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL2" 
  RegExValue="google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
  
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <!-- VersionOverrides for the v1.1 schema -->
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">

          <DesktopFormFactor>
            <!-- DetectedEntity -->
            <ExtensionPoint xsi:type="DetectedEntity">
              <Label resid="contextLabel" />
              <SourceLocation resid="detectedEntityURL" />
              <Rule xsi:type="RuleCollection" Mode="And">                                            
                <Rule xsi:type="ItemIs" ItemType="Message"/>
                  <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL" RegExValue="https://google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
                
    <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL2" 
  RegExValue="google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
<!--I have to use 2 Rules using AND because contextual add-ins do not directly work with urls -->
            </Rule>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
      
        <bt:Images>
          <bt:Image id="icon16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
          <bt:Image id="icon32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
          <bt:Image id="icon80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
        </bt:Images>
    
        <bt:Urls>
          <bt:Url id="detectedEntityURL" DefaultValue="https://localhost:3000/src/taskpane/index.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="contextLabel" DefaultValue="my outlook add-in "/>
        </bt:ShortStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>

我注意到以下规则与 AND 运算符链接:

<Rule xsi:type="RuleCollection" Mode="And">                                            
    <Rule xsi:type="ItemIs" ItemType="Message"/>
    <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL" RegExValue="https://google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
              
    <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="UURL2" 
  RegExValue="google\.com/[a-zA-Z0-9_]+" PropertyName="BodyAsPlaintext"/>
<!--I have to use 2 Rules using AND because contextual add-ins do not directly work with urls -->
</Rule>

因此,我建议使用单个正则表达式条件。如果它也不能正常工作,您可以尝试在 github 的 officejs 存储库上提交问题。或者尝试使用 https://github.com/OfficeDev/Outlook-Add-In-Contextual-Regex/blob/master/contoso-order-number-manifest.xml 中的示例 add-in .

您还需要确保 detectedEntityURL 文件在线可用。