直到我最近建立,我的cordova应用程序能够嵌入一个网站的iframe就好了; 现在,大概是在我忘记了更新后,构建应用程序导致iframe在iOS上空白但在Android中有效.
我已将以下设置添加到config.xml:
<access origin="*"/>
<access origin="*.pushwoosh.com" />
<access origin="*.hoby.org" />
<allow-navigation href="*" />
<allow-intent href="*" />
以及以下内容安全策略:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
哪个应该允许基本上一切.我使用cordova 6.1.0和Ionic 1.7.14添加了cordova-whitelist插件
编辑:它实际上适用于iOS模拟器,但不是在我在设备上运行时.
编辑2:似乎它可能是一个移动旅行问题; 我正在通过我的网络查看文件,甚至在科尔多瓦之外他们没有正确加载.我可以确认,这至少在几天前就有效了.
我正在尝试编写一个包含数据以遵循JSON API规范的过滤器,到目前为止,我已经将它用于所有直接返回ActionResult的情况,例如ComplexTypeJSON
.我试图让它ComplexType
在我不必Json
经常运行功能的情况下工作.
[JSONAPIFilter]
public IEnumerable<string> ComplexType()
{
return new List<string>() { "hello", "world" };
}
[JSONAPIFilter]
public JsonResult ComplexTypeJSON()
{
return Json(new List<string>() { "hello", "world" });
}
Run Code Online (Sandbox Code Playgroud)
但是,public override void OnActionExecuted(ActionExecutedContext filterContext)
当我导航到的时间运行时ComplexType
,它filterContext.Result
是一个内容结果,这只是一个filterContext.Result.Content
简单的字符串:
"System.Collections.Generic.List`1[System.String]"
Run Code Online (Sandbox Code Playgroud)
有没有一种方法,我可以安排时间,使ComplexType
成为JsonResult
而非ContentResult
?
对于上下文,这里是确切的文件:
TestController.cs
namespace MyProject.Controllers
{
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using MyProject.Filters;
public class TestController : Controller
{
[JSONAPIFilter]
public IEnumerable<string> ComplexType() …
Run Code Online (Sandbox Code Playgroud) 在构建之间(我不确定是什么改变来触发这个),一个应用程序来自iOS中的以下行为.
index.html
,并且有一个iframe,其中包含许多锚点index.html
至:
index.html
,并且有一个iframe,其中包含许多锚点我安装了最新版本cordova-plugin-inappbrowser
(此时为1.3.0),但这似乎并没有干扰任何事情.
我已经验证我仍然可以使用JavaScript index.html
来更改框架内锚点的属性,以及添加事件.
我使用以下CSP:
<meta http-equiv="Content-Security-Policy"
content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';">
我不确定这是否与它有关.
我尝试了一些iframe沙箱属性试图看到什么棒,但没有一个改变结果.目前它位于:
<iframe id="the-iframe" sandbox="allow-scripts allow-modals allow-popups allow-popups-to-escape-sandbox allow-top-navigation allow-forms allow-same-origin"></iframe>
该src
iframe的动态设置.
我已经打开了一个关于cordova 的错误报告,看看这是否可能是一个bug而不是一个功能.
我目前正在尝试从第二个控制器(搜索控制器)重定向到一个控制器(公司控制器)的索引.在我的搜索控制器中,我有以下代码:
RedirectToAction("Index", "Company", new { id = redirectTo.Id, fromSearch = true, fromSearchQuery = q })
Run Code Online (Sandbox Code Playgroud)
但不幸的是,这需要我:
/Company/Index/{id}?fromSearch=true&fromSearchQuery={q}
Run Code Online (Sandbox Code Playgroud)
其中fromSearch和fromSearchQuery是不常用的可选参数.
Is there a way to either directly get the URL from RedirectToAction so I can encase it in a Redirect after I chop out the Index part of the string, or set up routes with the optional parameters?
我正在尝试开发一个Chrome扩展程序,将Angular应用程序注入用户的浏览器窗口,以便创建一个交互式侧边栏.通过内容脚本将iframe添加到页面并将框架的源设置为扩展目录中的html文件,我大部分都能够达到我想要的100%.
不幸的是,因为Angular应用程序有多个路由(允许用户登录并查看许多不同类型的信息),我发现它正在干扰用户按预期使用其后退/前进按钮; 由于哈希值发生变化,iframe的源会发生变化,因此会为历史记录保存一个新条目.
我似乎无法为此找到或创建一个解决方法; 是否有一些聪明的方法可以使Angular不生成历史条目,或者实现创建不使用iframe而不保存到历史记录的侧边栏,或禁用iframe保存到历史记录?
javascript html5 browser-history google-chrome-extension angularjs
首先,我知道这是一个标题.
我最近接管了angular-tooltip,并试图为我的主要工作项目构建一个自定义工具提示.
在我的项目中,我有一个简单的ng-repeat指令
<div class="row-submenu-white" ng-repeat="merge in potentialMerges | limitTo: numPotentialMergesVisible" company-profile-tooltip="merge.preview"></div>
Run Code Online (Sandbox Code Playgroud)
使用库的说明,我定义了一个自定义工具提示指令:
myApp.directive('companyProfileTooltip', ['$tooltip', ($tooltip) => {
return {
restrict: 'EA',
scope: { profile: '@companyProfileTooltip' },
link: (scope: ng.IScope, elem) => {
var tooltip = $tooltip({
target: elem,
scope: scope,
templateUrl: "/App/Private/Content/Common/company.profile.html",
tether: {
attachment: 'middle right',
targetAttachment: 'middle left',
offset: '0 10px'
}
});
$(elem).hover(() => {
tooltip.open();
}, () => {
tooltip.close();
});
}
};
}]);
Run Code Online (Sandbox Code Playgroud)
Company.profile.html简单地说:
<div>Hello, world!</div>
Run Code Online (Sandbox Code Playgroud)
现在,如果你注意到,在ng-repeat中我有一个limitTo
过滤器.对于每个(初始3)合并工作完美,在<div>Hello, world!</div>
正确添加工具提示的地方. …
我试图遵循参考指南以确保某些索引最终出现在某些机器上。我试图为我的 2 个节点提供一个名为“storage_type”的属性,其中一个节点获得“long_term”,一个节点获得“short_term”。
据我了解,我需要为每个节点添加“storage_type”属性,然后将每个索引分别设置为 has{"index.routing.allocation.require.tag" : "short"}
或{"index.routing.allocation.require.tag" : "long"}
。
我尝试通过curl
调用添加这些设置,就像大多数 ES 的东西一样,但似乎我无法PUT
设置。IE:
curl -XPUT localhost:9200/_nodes/my_node_name/_settings -d '{"storage_term" : "short_term"}'
Run Code Online (Sandbox Code Playgroud)
那么如何添加这些属性,例如“storage_type”(节点的n)?它是一个配置文件吗?命令行参数?我缺少 HTTP 调用吗?
我正在尝试使用常规格式提交对象数组,而不使用AJAX,并且发现与其将请求正文解析为对象数组,它只是具有对应于对象名称的许多字段,而不是将其解析为对象数组。
我知道,在提交基本数组时,只需用相同的名称填充许多输入,然后它将填充。但是,我似乎无法将其应用于复杂对象。
我的表单代码非常简单:
<div class="col-sm-9">
<div class="row">
<div class="col-md-6">
<div class="form">
<div class="form-group">
<label for="attachment[0].name" class="control-label">Name</label>
<input name="attachment[0].name" class="form-control" value="First Name" type="text">
</div>
<div class="form-group">
<label for="attachment[0].uri" class="control-label">URI</label>
<input name="attachment[0].uri" class="form-control" value="First URI" type="text">
</div>
<div class="form-group">
<label for="attachment[0].description" class="control-label">Description</label>
<textarea rows="4" value="First Description" name="attachment[0].description" class="form-control">First Description</textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form">
<div class="form-group">
<label for="attachment[1].name" class="control-label" >Name</label>
<input name="attachment[1].name" class="form-control" value="Second Name" type="text">
</div>
<div class="form-group">
<label for="attachment[1].uri" class="control-label">URI</label>
<input name="attachment[1].uri" class="form-control" value="Second URI" …
Run Code Online (Sandbox Code Playgroud) angularjs ×2
asp.net ×2
cordova ×2
iframe ×2
javascript ×2
asp.net-mvc ×1
c# ×1
cordova-ios ×1
express ×1
html ×1
html5 ×1
ios ×1
jquery ×1
node.js ×1
tether ×1