get_headers = (req, version_tag, description, extras = []) => {
  const state = getState();
  const favicon = state.getConfig("favicon_id", null);
  const notification_in_menu = state.getConfig("notification_in_menu");
  const pwa_enabled = state.getConfig("pwa_enabled");
  const is_root = req.user?.role_id === 1;

  const iconHeader = favicon
    ? [
        {
          headerTag: `<link rel="icon" type="image/png" href="/files/serve/${favicon}">`,
        },
      ]
    : [];
  const meta_description = description
    ? [
        {
          headerTag: `<meta name="description" content="${description}">`,
        },
      ]
    : [];
  const locale = req.getLocale();
  const stdHeaders = [
    {
      headerTag: `<script>var _sc_loglevel = ${
        state.logLevel
      }, _sc_globalCsrf = "${req.csrfToken()}", _sc_version_tag = "${version_tag}"${
        locale ? `, _sc_locale = "${locale}"` : ""
      }, _sc_lightmode = ${JSON.stringify(
        state.getLightDarkMode?.(req.user) || "light"
      )};</script>`,
    },
    { css: `/static_assets/${version_tag}/saltcorn.css` },
    { script: `/static_assets/${version_tag}/saltcorn-common.js` },
    { script: `/static_assets/${version_tag}/saltcorn.js` },
    { script: `/static_assets/${version_tag}/dayjs.min.js` },
  ];
  if (locale !== "en") {
    stdHeaders.push({
      script: `/static_assets/${version_tag}/dayjslocales/${locale}.js`,
    });
  }
  let from_cfg = [];
  if (state.getConfig("page_custom_css", ""))
    from_cfg.push({ style: state.getConfig("page_custom_css", "") });
  if (state.getConfig("page_custom_html", ""))
    from_cfg.push({ headerTag: state.getConfig("page_custom_html", "") });
  if (state.getConfig("log_client_errors", false))
    from_cfg.push({ scriptBody: `enable_error_catcher()` });
  const state_headers = [];
  for (const hs of Object.values(state.headers)) {
    state_headers.push(...hs);
  }
  if (notification_in_menu)
    from_cfg.push({ scriptBody: domReady(`check_saltcorn_notifications()`) });
  if (pwa_enabled) {
    from_cfg.push({
      headerTag: `<link rel="manifest" href="/notifications/manifest.json${
        is_root ? new Date().valueOf() : ""
      }">`,
    });
    from_cfg.push({
      scriptBody: `if('serviceWorker' in navigator) {
        navigator.serviceWorker.register('/serviceworker.js', { scope: '/' });
      }`,
    });
  }
  return [
    ...stdHeaders,
    ...iconHeader,
    ...meta_description,
    ...state_headers,
    ...extras,
    ...from_cfg,
  ];
}
Get Headers
@param req
@param version_tag
@param description
@param extras
@returns {*[]}