在我的应用程序中,我想定义 - 共享和选择活动。但是,当我打电话给#34;选择"我的应用程序中的活动 - 它允许我选择我自己的应用程序,这会产生循环漏洞。我可以以某种方式避免这种情况吗?
"activities": {
"share": {
"href": "./share-activity.html",
"disposition": "window",
"filters": {
"type": ["image/*","image/jpeg","image/png"]
},
"returnValue": true
},
"pick": {
"href": "./pick-activity.html",
"disposition": "inline",
"filters": {
"type": ["image/*","image/jpeg","image/png"]
},
"returnValue": true
}
答案 0 :(得分:0)
尝试类似:
"activities": {
"pick": {
"href": "./index.html",
"disposition": "inline",
"filters": {
"type": "image/*",
"appname": "abc"
},
"returnValue": true
}
}
然后在调用pick活动的代码中,您可以通过调用以下内容来避开您的应用:
var pick = new MozActivity({
name: "pick",
data: {
type: "image/*",
appname: "xyz"
}
});
添加appname:“abc”或删除appname字段将在列表中显示您的应用。 示例代码:github.com/JasonWeathersby/TestActivity