Action.js 627 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // Action.js
  3. // OpenInActionExtension
  4. //
  5. // Created by Marcus Kida on 03.01.23.
  6. //
  7. var Action = function() {};
  8. Action.prototype = {
  9. run: function(arguments) {
  10. var payload = {
  11. "url": document.documentURI
  12. }
  13. arguments.completionFunction(payload)
  14. },
  15. finalize: function(arguments) {
  16. const alertMessage = arguments["alert"]
  17. const openURL = arguments["openURL"]
  18. if (alertMessage) {
  19. alert(alertMessage)
  20. } else if (openURL) {
  21. window.location = openURL
  22. }
  23. }
  24. };
  25. var ExtensionPreprocessingJS = new Action