void (@NotNull AnActionEvent event) { Project project = event.getRequiredData(CommonDataKeys.PROJECT); PsiFile psiFile = event.getRequiredData(CommonDataKeys.PSI_FILE); 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")); } }