Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: amysteamdev <[email protected]>
  • Loading branch information
oliverdunk and AmySteam authored Oct 31, 2023
1 parent e64bb10 commit 4f6e9f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion api-samples/readingList/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ This sample demonstrates using the [chrome.readingList](https://developer.chrome

## Overview

Once this extension is installed, clicking this extension's action icon will open an extension page.
The extension's action icon opens a page that allows you to add new items, as well as update or delete existing ones.

<img src="screenshot.png" height=300 alt="Screenshot showing the chrome.readingList API demo running in Chrome.">

## Running this extension

1. Clone this repository.
2. Load this directory in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked).
3. Click on the action icon.
4. An extension page will open.

## Implementation Notes

Listeners are added for all events, so the table automatically updates when data in the reading list changes.
2 changes: 1 addition & 1 deletion api-samples/readingList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function updateUI() {
for (const item of items) {
// Use existing row if possible, otherwise create a new one.
const row =
document.querySelector(`[data-url="${item.url}"`) ||
document.querySelector(`[data-url="${item.url}"]`) ||
document.getElementById(TABLE_ITEM_TEMPLATE_ID).content.cloneNode(true)
.children[0];

Expand Down
2 changes: 1 addition & 1 deletion api-samples/readingList/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Reading List API Demo",
"version": "1.0",
"manifest_version": 3,
"description": "Uses the chrome.readingList API to display reading list entries.",
"description": "Uses the chrome.readingList API to display, update and remove reading list entries.",
"background": {
"service_worker": "sw.js"
},
Expand Down

0 comments on commit 4f6e9f8

Please sign in to comment.