()
| 354 | |
| 355 | // Update favorite status for the active tab |
| 356 | function updateFavoriteIcon() { |
| 357 | if (activeTabId == INVALID_TAB_ID) { |
| 358 | return; |
| 359 | } |
| 360 | |
| 361 | let activeTab = tabs.get(activeTabId); |
| 362 | isFavorite(activeTab.uri, (isFavorite) => { |
| 363 | let favoriteElement = document.getElementById('btn-fav'); |
| 364 | if (!favoriteElement) { |
| 365 | refreshControls(); |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | if (isFavorite) { |
| 370 | favoriteElement.classList.add('favorited'); |
| 371 | activeTab.isFavorite = true; |
| 372 | } else { |
| 373 | favoriteElement.classList.remove('favorited'); |
| 374 | activeTab.isFavorite = false; |
| 375 | } |
| 376 | }); |
| 377 | |
| 378 | } |
| 379 | |
| 380 | function updateNavigationUI(reason) { |
| 381 | switch (reason) { |
no test coverage detected