@Override
  public void actionPerformed(@NotNull AnActionEvent event) {
    Project project = event.getData(CommonDataKeys.PROJECT);
    if (project == null) return;
    PsiFile psiFile = event.getData(CommonDataKeys.PSI_FILE);
    if (psiFile == null) return;
    VirtualFile virtualFile = psiFile.getVirtualFile();
    boolean preferLocalFileUrl = BitUtil.isSet(event.getModifiers(), ActionEvent.SHIFT_MASK);

    try {
      OpenInBrowserRequest browserRequest = createOpenInBrowserRequest(psiFile, false);
      if (browserRequest == null) return;
      browserRequest.setReloadMode(WebBrowserManager.getInstance().getWebPreviewReloadMode());
      Collection<Url> urls = WebBrowserService.getInstance().getUrlsToOpen(browserRequest, preferLocalFileUrl);
      if (!urls.isEmpty()) {
        BaseOpenInBrowserActionKt.chooseUrl(urls).onSuccess((url) -> {
          WebPreviewVirtualFile file = new WebPreviewVirtualFile(virtualFile, url);
          if (!FileEditorManager.getInstance(project).isFileOpen(file)) {
            OpenInRightSplitAction.Companion.openInRightSplit(
              project,
              file,
              null,
              false
            );
          }
          else {
            FileEditorManagerEx.getInstanceEx(project).openFile(file, null, new FileEditorOpenOptions().withReuseOpen());
          }
        });
      }
    }
    catch (WebBrowserUrlProvider.BrowserException e) {
      Messages.showErrorDialog(e.getMessage(), IdeBundle.message("browser.error"));
    }
  }
@Override
  public void actionPerformed(@NotNull AnActionEvent event)