ForgeComponents
en

Components

j-FaviconUnread

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

Configuration

  • fg {String} foreground color (default: white)
  • bg {String} backround color (default: red)
  • selector {String} optional, selector for a specific image element (default: favicon in head of HTML)
  • NEW badge {Boolean} optional, enables usage of navigator.setAppBadge() (default: true)

Use it with <ui-component name="faviconunread">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<!-- REMOVE "selector:#favicon" IN YOUR PROJECT!!! -->
<ui-component name="faviconunread" path="common.unread" config="selector:#favicon"></ui-component>

<div>
	<img src="/favicon.ico" id="favicon" />
</div>

<script>
	SET('common.unread', 4, 2000);
</script>