Remove top-level await

This commit is contained in:
Oliver Dunk
2024-11-25 16:29:50 +00:00
parent a623fcb9bb
commit 3e5da96f10

View File

@@ -93,15 +93,17 @@ Add the following to `sidepanel.js`:
```js
const LIST_ELEMENT = document.querySelector('ul');
const tabs = await chrome.tabs.query({
currentWindow: true
});
for (const tab of tabs) {
const element = document.createElement('li');
element.innerText = tab.title;
LIST_ELEMENT.append(element);
}
chrome.tabs
.query({
currentWindow: true
})
.then((tabs) => {
for (const tab of tabs) {
const element = document.createElement('li');
element.innerText = tab.title;
LIST_ELEMENT.append(element);
}
});
```
You now have a basic UI showing tabs!