Skip to content

Commit

Permalink
Simplify fuction to use find instead of filter
Browse files Browse the repository at this point in the history
Update README to link to roll printing info.
  • Loading branch information
nmuggli committed Nov 2, 2023
1 parent 6263331 commit 294acb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api-samples/printing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `chrome.printing` namespace only works on ChromeOS. The sample demonstrates

Calling `submitJob()` triggers a dialog box asking the user to confirm printing. Use the [`PrintingAPIExtensionsAllowlist`](https://chromeenterprise.google/policies/#PrintingAPIExtensionsAllowlist") policy to bypass confirmation.

If the `'Roll Printers'` checkbox is selected, only printers capable of roll printing will appear in the table. In this case, a separate test file is printed and the height of the media can be variable.
If the `'Roll Printers'` checkbox is selected, only printers capable of roll printing will appear in the table. In this case, a separate test file is printed and the height of the media can be variable. See [`Roll printing`](https://developer.chrome.com/docs/extensions/reference/printing/#roll-printing) for more information.

## Implementation Notes

Expand Down
6 changes: 1 addition & 5 deletions api-samples/printing/printers.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,8 @@ function addCell(parent) {

function supportsRollPrinting(printerInfo) {
// If any of the media size options support continuous feed, return true.
const newOptions = printerInfo.capabilities.printer.media_size.option.filter(
return printerInfo.capabilities.printer.media_size.option.find(
(option) => option.is_continuous_feed);
if (newOptions.length > 0) {
return true;
}
return false;
}

function createPrintersTable() {
Expand Down

0 comments on commit 294acb4

Please sign in to comment.