html - 添加了 UWP applicationcontenturirules url 规则但不适用于 iframe

标签 html iframe uwp navigation winjs

我正在使用 typescript 和 winjs 使用 UWP 商店应用程序。根据要求,我们需要在我们的应用程序中加载远程网页,并且该页面需要一些表单参数,这些参数无法通过查询字符串设置为大小限制。所以我们决定使用允许接收表单发布数据的 IFrame。为此,我已将远程网页 URI 添加到程序包 list 的 ApplicationContentUriRules 部分。 但是在执行表单后操作时让我低于错误。

APPHOST9625: Unable to navigate to: 'https://www.mytestweb.com/'. An iframe attempted to navigate to a URI that is not included in the ApplicationContentUriRules for this app. Use a x-ms-webview element to view the URI instead, or add the URI to the ApplicationContentUriRules section of the package manifest so that the iframe can navigate to it. (In Visual Studio, add this URI to the Content URIs tab of the Manifest Designer.)

我有什么遗漏或错误的吗?我需要帮助来解决这个问题。

下面是我的示例代码,

<form id="my-form" action="https://www.mytestweb.com/operations" method='post' target="my-iframe">
    <div class="col">
        <div class="row">
            <input type="hidden" name="token" value="largeTokenString" />
        </div>
        <div class="row">
            <input type="hidden" name="transaction" value="serializedTransactionData" />
        </div>
        <div class="buttonContainer">
            <button type="submit" data-bind="click: postFromData">Post</button>
        </div>
    </div>
</form>
<iframe id="my-iframe" name="my-iframe" src="about:blank"></iframe>

当我从 post 按钮提交时,远程 URL 加载了表单数据,没有数据,我的远程 URL 就不会加载。

最佳答案

我能够解决我的问题。我的一位团队成员问我,你怎么知道你的应用程序引用更新的应用程序 list 。我不知道我在哪里找到这个。 所以我已经从计算机上卸载了我的应用程序,使用应用程序名称搜索和删除从应用程序数据中清除了应用程序内存。使用 msbuild 命令创建新应用程序包并安装新应用程序,现在我的应用程序能够在 IFrame 中成功加载远程 URL。

关于html - 添加了 UWP applicationcontenturirules url 规则但不适用于 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53444867/

相关文章:

javascript - 无法使用 iframe 加载外部网站

c# - 如何使用SQLite.Net-PCL进行低级查询?

html - css 可打印大小和 pdf

python - 如何在Python中使用selenium获取iframe中包含的内部html文档?

html - 使用 iFrame 加载本地 html 文件

c# - 避免 .NET Native 错误

c# - 在 UWP 中的 Drop Event 上获取实际放置的 UIElement 对象

html - html5 链接预取会影响 Google Analytics 吗?

javascript - 更新 CSS 规则属性值

html - 如何为网站制作程序?我应该知道什么类型的技能/代码?