2017-04-29 11:08:49 +00:00
|
|
|
function browse(params, context) {
|
2017-02-28 09:14:55 +00:00
|
|
|
var url;
|
|
|
|
|
2017-05-08 12:19:09 +00:00
|
|
|
if (params.metadata && params.metadata.url
|
|
|
|
&& params.metadata.url !== "undefined" && params.metadata.url != "") {
|
|
|
|
url = params.metadata.url;
|
|
|
|
}
|
|
|
|
|
2017-02-28 09:14:55 +00:00
|
|
|
if (params.url && params.url !== "undefined" && params.url != "") {
|
|
|
|
url = params.url;
|
2017-05-08 12:19:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (url && !/^[a-zA-Z-_]+:/.test(url)) {
|
|
|
|
url = 'http://' + url;
|
2017-02-28 09:14:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
title: "Browser",
|
|
|
|
dynamicTitle: true,
|
2017-04-29 11:08:49 +00:00
|
|
|
singleLineInput: true,
|
|
|
|
actions: [
|
|
|
|
{
|
|
|
|
type: status.actions.WEB_VIEW_BACK
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: status.actions.WEB_VIEW_FORWARD
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: status.actions.FULLSCREEN
|
|
|
|
},
|
|
|
|
],
|
2017-02-28 09:14:55 +00:00
|
|
|
markup: status.components.bridgedWebView(url)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
status.command({
|
|
|
|
name: "global",
|
|
|
|
title: I18n.t('browse_title'),
|
|
|
|
registeredOnly: true,
|
|
|
|
description: I18n.t('browse_description'),
|
|
|
|
color: "#ffa500",
|
|
|
|
fullscreen: true,
|
|
|
|
params: [{
|
|
|
|
name: "url",
|
|
|
|
type: status.types.TEXT,
|
|
|
|
placeholder: "URL"
|
|
|
|
}],
|
2017-04-29 11:08:49 +00:00
|
|
|
onSend: browse
|
2017-02-28 09:14:55 +00:00
|
|
|
});
|