MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Browser / updateFavoriteIcon

Function updateFavoriteIcon

wvbrowser_ui/controls_ui/default.js:356–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

354
355// Update favorite status for the active tab
356function 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
380function updateNavigationUI(reason) {
381 switch (reason) {

Callers 3

messageHandlerFunction · 0.85
updateNavigationUIFunction · 0.85
toggleFavoriteFunction · 0.85

Calls 2

isFavoriteFunction · 0.85
refreshControlsFunction · 0.85

Tested by

no test coverage detected