Example #1
0
 public static BaseNMResponse Process(CompatibilityRequest request)
 {
     try
     {
         var status = ExtensionVersionHelper.GetCompatibiltyStatus(request.ExtensionVersion, out var appVersion);
         return(new CompatibilityResponse(appVersion, status));
     }
     catch (Exception e)
     {
         return(new FailedResponse(e.Message));
     }
 }
        public static void Process()
        {
            var request = GetNativeMessagingContent();

            var response = request switch
            {
                CompatibilityRequest m => CompatibilityAction.Process(m),
                OpenChromeRequest m => OpenChromeAction.Process(m),
                _ => new FailedResponse("Could not process the incoming message"),
            };

            SendNativeMessagingResponse(response);
        }