INNER CODE UNIT · JavaScript

markSearchUnavailable

mitre-attack/attack-website · attack-search/src/index.js:97

function markSearchUnavailable(reason) {
  searchServiceUnavailable = true;
  searchServiceIsLoaded = false;
  searchInput.prop('disabled', true);
  searchButton.prop('disabled', true);
  searchIcon.removeClass('search-icon');
  searchIcon.addClass('error-icon');
  searchButton.prop('title', reason);
}

// Remove a failed cached index so the next page load rebuilds it instead of retrying
// the same restore path. Cache cleanup is best-effort and must not mask the original
// initialization failure or prevent the unavailable UI state from being shown.
async function invalidateSearchCache() {
  try {
    localStorage.removeItem(searchCacheKey);
  } catch (error) {
    console.error('Failed to remove the search cache marker:', error);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…