Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
- Fix typo `thumnail-image` -> `thumbnail-image` in listing template ([#4602](//github.com/quarto-dev/quarto-cli/pull/4602)) (Thank you, @mattspence!).
- Add support for targeting the `#refs` divs with citations when using `natbib` or `biblatex` to generate a bibliography.
- Warn users about Chromium installation issues in WSL ([#4596](https://github.com/quarto-dev/quarto-cli/issues/4586)).
- Fix issue with "No inspectable targets" with Chrome Browser ([#4653](https://github.com/quarto-dev/quarto-cli/issues/4653))
- Add `title` attribute for callouts (can be used rather than heading for defining the title)

## Pandoc filter changes
Expand Down
1 change: 1 addition & 0 deletions src/core/cri/cri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export async function criClient(appPath?: string, port?: number) {
for (let i = 0; i < maxTries; ++i) {
try {
client = await cdp({ port });
break;
} catch (e) {
if (i === maxTries - 1) {
throw e;
Expand Down
38 changes: 24 additions & 14 deletions src/core/cri/deno-cri/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,30 @@ export default class Chrome extends EventEmitter {
constructor(options, notifier) {
super();
// options
const defaultTarget = (targets) => {
// prefer type = 'page' inspectable targets as they represents
// browser tabs (fall back to the first inspectable target
// otherwise)
let backup;
let target = targets.find((target) => {
if (target.webSocketDebuggerUrl) {
backup = backup || target;
return target.type === "page";
} else {
return false;
const defaultTarget = async (targets) => {
let target;
// If no targets available in browser, create a new one
// Related to https://github.com/quarto-dev/quarto-cli/issues/4653
if (!targets.length) {
target = await devtools.New(options);
if (!target.id) {
throw new Error("No inspectable targets and unable to create one");
}
});
target = target || backup;
} else {
// prefer type = 'page' inspectable targets as they represents
// browser tabs (fall back to the first inspectable target
// otherwise)
let backup;
target = targets.find((target) => {
if (target.webSocketDebuggerUrl) {
backup = backup || target;
return target.type === "page";
} else {
return false;
}
});
target = target || backup;
}
if (target) {
return target;
} else {
Expand Down Expand Up @@ -228,7 +238,7 @@ export default class Chrome extends EventEmitter {
case "function": {
const func = userTarget;
const targets = await devtools.List(options);
const result = func(targets);
const result = await func(targets);
const object = typeof result === "number" ? targets[result] : result;
return object.webSocketDebuggerUrl;
}
Expand Down