1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-09 23:25:49 +01:00
mastodon-app-ufficiale-ipho.../OpenInActionExtension/Action.js
Marcus Kida 3ec9e603df
Improve "Open in Mastodon" by using Search API (#888)
* feat(ActionExtension): Improve "Open in Mastodon" by using Search aPI

* Add code comment
2023-01-16 23:36:00 +01:00

31 lines
627 B
JavaScript

//
// Action.js
// OpenInActionExtension
//
// Created by Marcus Kida on 03.01.23.
//
var Action = function() {};
Action.prototype = {
run: function(arguments) {
var payload = {
"url": document.documentURI
}
arguments.completionFunction(payload)
},
finalize: function(arguments) {
const alertMessage = arguments["alert"]
const openURL = arguments["openURL"]
if (alertMessage) {
alert(alertMessage)
} else if (openURL) {
window.location = openURL
}
}
};
var ExtensionPreprocessingJS = new Action