Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

567 B
Raw Blame
const ACTION_TITLE_MESSAGES = Object.freeze({
  action_title_supported: "Send this media page to LibreGet",
  action_title_unsupported: "No supported media detected on this page",
});

function defaultGetMessage(name) {
  if (typeof chrome === "undefined" || !chrome.i18n?.getMessage) {
    return "";
  }
  return chrome.i18n.getMessage(name);
}

export function resolveActionTitle(supported, getMessage = defaultGetMessage) {
  const key = supported ? "action_title_supported" : "action_title_unsupported";
  return getMessage(key) || ACTION_TITLE_MESSAGES[key];
}