2023-01-06 13:54:42 +01:00
|
|
|
//
|
|
|
|
// Action.js
|
2023-01-10 16:40:20 +01:00
|
|
|
// OpenInActionExtension
|
2023-01-06 13:54:42 +01:00
|
|
|
//
|
|
|
|
// Created by Marcus Kida on 03.01.23.
|
|
|
|
//
|
|
|
|
|
|
|
|
var Action = function() {};
|
|
|
|
|
|
|
|
Action.prototype = {
|
|
|
|
run: function(arguments) {
|
2023-01-11 13:09:23 +01:00
|
|
|
var payload = {
|
|
|
|
"url": document.documentURI
|
2023-01-10 16:40:20 +01:00
|
|
|
}
|
2023-01-11 13:09:23 +01:00
|
|
|
|
|
|
|
arguments.completionFunction(payload)
|
2023-01-06 13:54:42 +01:00
|
|
|
},
|
|
|
|
finalize: function(arguments) {
|
2023-01-16 23:36:00 +01:00
|
|
|
const alertMessage = arguments["alert"]
|
|
|
|
const openURL = arguments["openURL"]
|
|
|
|
|
2023-01-11 15:12:07 +01:00
|
|
|
if (alertMessage) {
|
|
|
|
alert(alertMessage)
|
2023-01-16 23:36:00 +01:00
|
|
|
} else if (openURL) {
|
|
|
|
window.location = openURL
|
2023-01-11 15:12:07 +01:00
|
|
|
}
|
2023-01-06 13:54:42 +01:00
|
|
|
}
|
|
|
|
};
|
2023-01-10 16:40:20 +01:00
|
|
|
|
2023-01-06 13:54:42 +01:00
|
|
|
var ExtensionPreprocessingJS = new Action
|