mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
Remove top-level await
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user