configuration.rst 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/configuration.rst">Edit me on GitHub</a></div>
  3. =============
  4. Configuration
  5. =============
  6. The included minified JavaScript and CSS files can be used for demoing or testing, but
  7. you'll want to configure *Converse.js* to suit your needs before you deploy it
  8. on your website.
  9. *Converse.js* is passed its configuration settings when you call its *initialize* method.
  10. You'll most likely want to call the *initialize* method in your HTML page. For
  11. an example of how this is done, please see the bottom of the *./index.html* page.
  12. Please refer to the `Configuration settings`_ section below for info on
  13. all the available configuration settings.
  14. After you have configured *Converse.js*, you'll have to regenerate the minified
  15. JavaScript file so that it will include the new settings. Please refer to the
  16. :ref:`minification` section for more info on how to do this.
  17. .. _`configuration-settings`:
  18. Configuration settings
  19. ======================
  20. authentication
  21. --------------
  22. * Default: ``login``
  23. * Allowed values: `login`_, `external`, `anonymous`_, `prebind`_
  24. This option states the way converse.js will authenticate.
  25. login
  26. ~~~~~
  27. The default means is ``login``, which means that the user either logs in manually with their
  28. username and password, or automatically if used together with ``auto_login=true``
  29. and ``jid`` and ``password`` values. See `auto_login`_.
  30. external
  31. ~~~~~~~~
  32. This setting will still show a login form and submit button, but the form will
  33. only contain an input for the user's JID, *not* for the password.
  34. That's because this setting is intended to be used when you are using
  35. SASL-EXTERNAL as authentication mechanism, in which case a password is usually
  36. not required.
  37. SASL-EXTERNAL is generally used together with x509 client certificates to
  38. enable passwordless login or 2-factor authentication.
  39. For more details on this, `read this blog post <https://opkode.com/blog/strophe_converse_sasl_external/>`_.
  40. anonymous
  41. ~~~~~~~~~
  42. This enables anonymous login if the XMPP server supports it. This option can be
  43. used together with `auto_login`_ to automatically and anonymously log a user in
  44. as soon as the page loads.
  45. The server's domain is passed in via the `jid`_ setting.
  46. prebind
  47. ~~~~~~~
  48. See also: :ref:`session-support`
  49. Use this option when you want to attach to an existing XMPP
  50. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  51. Usually a BOSH session is set up server-side in your web app.
  52. Attaching to an existing BOSH session that was set up server-side is useful
  53. when you want to maintain a persistent single session for your users instead of
  54. requiring them to log in manually.
  55. When a BOSH session is initially created, you'll receive three tokens.
  56. A JID (jabber ID), SID (session ID) and RID (Request ID).
  57. Converse.js needs these tokens in order to attach to that same session.
  58. There are two complementary configuration settings to ``prebind``.
  59. They are :ref:`keepalive` and `prebind_url`_.
  60. ``keepalive`` can be used keep the session alive without having to pass in
  61. new RID and SID tokens to ``converse.initialize`` every time you reload the page.
  62. This removes the need to set up a new BOSH session every time a page loads.
  63. You do however still need to supply the user's JID so that converse.js can be
  64. sure that the session it's resuming is for the right user.
  65. `prebind_url`_ lets you specify a URL which converse.js will call whenever a
  66. new BOSH session needs to be set up.
  67. Here's an example of converse.js being initialized with these three options:
  68. .. code-block:: javascript
  69. converse.initialize({
  70. bosh_service_url: 'https://bind.example.com',
  71. keepalive: true,
  72. jid: 'me@example.com',
  73. authentication: 'prebind',
  74. prebind_url: 'http://example.com/api/prebind',
  75. allow_logout: false
  76. });
  77. allow_bookmarks
  78. ---------------
  79. * Default: ``true``
  80. Enables/disables chatroom bookmarks functionality.
  81. This setting is only applicable if the ``converse-bookmarks`` plugin is loaded.
  82. See also: `allow_public_bookmarks`_
  83. allow_chat_pending_contacts
  84. ---------------------------
  85. * Default: ``false``
  86. Allow the user to chat with pending contacts.
  87. allow_contact_removal
  88. ---------------------
  89. * Default: ``true``
  90. Allow the user to remove roster contacts by clicking on the delete icon
  91. (i.e. trashcan) next to a contact's name in the roster.
  92. allow_contact_requests
  93. ----------------------
  94. * Default: ``true``
  95. Allow users to add one another as contacts. If this is set to false, the
  96. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  97. sections will all not appear. Additionally, all incoming contact requests will be
  98. ignored.
  99. allow_dragresize
  100. ----------------
  101. * Default: ``true``
  102. Allow users to resize chats by dragging the edges. The min-height and min-width
  103. CSS properties set on a chatboxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
  104. will be honored, IF they are set in pixels.
  105. allow_muc
  106. ---------
  107. * Default: ``true``
  108. Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
  109. the ``Chatrooms`` tab from the control box.
  110. allow_muc_invitations
  111. ---------------------
  112. * Default: ``true``
  113. Allows users to be invited to join MUC chatrooms. An "Invite" widget will
  114. appear in the sidebar of the chatroom where you can type in the JID of a user
  115. to invite into the chatroom.
  116. .. _`allow_non_roster_messaging`:
  117. allow_non_roster_messaging
  118. --------------------------
  119. * Default: ``false``
  120. Determines whether you'll receive messages from users that are not in your
  121. roster. The XMPP specification allows for this (similar to email).
  122. Setting this to `true` increases your chances of receiving spam (when using a
  123. federated server), while setting it to `false` means that people not on your
  124. roster can't contact you unless one (or both) of you subscribe to one another's
  125. presence (i.e. adding as a roster contact).
  126. allow_otr
  127. ---------
  128. * Default: ``true``
  129. Allow Off-the-record encryption of single-user chat messages.
  130. allow_public_bookmarks
  131. ----------------------
  132. * Default: ``false``
  133. Some XMPP servers don't support private PEP/PubSub nodes, as required for
  134. private bookmarks and outlined in `XEP-0223 <https://xmpp.org/extensions/xep-0223.html>`_.
  135. Even though Converse.js asks for the bookmarks to be kept private (via the
  136. `<publish-options>` XML node), the server simply ignores the privacy settings
  137. and publishes the node contents under the default privacy setting, which makes
  138. the information available to all roster contacts.
  139. If your your XMPP server does not support `XEP-0223`'s ``#publish-options``
  140. feature and you don't mind that your room bookmarks are visible to all
  141. contacts, then you can set this setting to ``true``. Otherwise you won't be
  142. able to have any room bookmarks at all for an account on that XMPP server.
  143. allow_registration
  144. ------------------
  145. * Default: ``true``
  146. Support for `XEP-0077: In band registration <http://xmpp.org/extensions/xep-0077.html>`_
  147. Allow XMPP account registration showing the corresponding UI register form interface.
  148. animate
  149. -------
  150. * Default: ``true``
  151. Show animations, for example when opening and closing chatboxes.
  152. archived_messages_page_size
  153. ---------------------------
  154. * Default: ``50``
  155. See also: `message_archiving`_
  156. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  157. and will only take effect if your server supports MAM.
  158. It allows you to specify the maximum amount of archived messages to be returned per query.
  159. When you open a chatbox or room, archived messages will be displayed (if
  160. available) and the amount returned will be no more than the page size.
  161. You will be able to query for even older messages by scrolling upwards in the chatbox or room
  162. (the so-called infinite scrolling pattern).
  163. auto_list_rooms
  164. ---------------
  165. * Default: ``false``
  166. If true, and the XMPP server on which the current user is logged in supports
  167. multi-user chat, then a list of rooms on that server will be fetched.
  168. Not recommended for servers with lots of chatrooms.
  169. For each room on the server a query is made to fetch further details (e.g.
  170. features, number of occupants etc.), so on servers with many rooms this
  171. option will create lots of extra connection traffic.
  172. .. _`auto_login`:
  173. auto_login
  174. ----------
  175. * Default: ``false``
  176. This option can be used to let converse.js automatically log the user in as
  177. soon as the page loads.
  178. It should be used either with ``authentication`` set to ``anonymous`` or to ``login``.
  179. If ``authentication`` is set to ``login``, then you will also need to provide a
  180. valid ``jid`` and ``password`` values, either manually by passing them in, or
  181. by the `credentials_url`_ setting. Setting a ``credentials_url`` is preferable
  182. to manually passing in ``jid`` and ``password`` values, because it allows
  183. better reconnection with ``auto_reconnect``. When the connection drops,
  184. converse.js will automatically fetch new login credentials from the
  185. ``credentials_url`` and reconnect.
  186. If ``authentication`` is set to ``anonymous``, then you will also need to provide the
  187. server's domain via the `jid`_ setting.
  188. This is a useful setting if you'd like to create a custom login form in your
  189. website. You'll need to write some JavaScript to accept that custom form's
  190. login credentials, then you can pass those credentials (``jid`` and
  191. ``password``) to ``converse.initialize`` to start converse.js and log the user
  192. into their XMPP account.
  193. auto_away
  194. ---------
  195. * Default: ``0``
  196. The amount of seconds after which the user's presence status should
  197. automatically become ``away``.
  198. If the user's status is ``extended away``, it won't be changed to ``away``.
  199. If the given value is negative or ``0``, this option is disabled.
  200. auto_xa
  201. -------
  202. * Default: ``0``
  203. The amount of seconds after which the user's presence status should
  204. automatically become ``extended away``.
  205. If the value is negative or ``0``, the function is disabled.
  206. auto_reconnect
  207. --------------
  208. * Default: ``false``
  209. Automatically reconnect to the XMPP server if the connection drops
  210. unexpectedly.
  211. This option works best when you have `authentication` set to `prebind` and have
  212. also specified a `prebind_url` URL, from where converse.js can fetch the BOSH
  213. tokens. In this case, converse.js will automaticallly reconnect when the
  214. connection drops but also reestablish earlier lost connections (due to
  215. network outages, closing your laptop etc.).
  216. When `authentication` is set to `login`, then this option will only work when
  217. the page hasn't been reloaded yet, because then the user's password has been
  218. wiped from memory. This configuration can however still be useful when using
  219. converse.js in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  220. or `electron <http://electron.atom.io/>`_.
  221. auto_subscribe
  222. --------------
  223. * Default: ``false``
  224. If true, the user will automatically subscribe back to any contact requests.
  225. auto_join_on_invite
  226. -------------------
  227. * Default: ``false``
  228. If true, the user will automatically join a chatroom on invite without any confirm.
  229. auto_join_rooms
  230. ---------------
  231. * Default: ``[]``
  232. This settings allows you to provide a list of groupchat conversations to be
  233. automatically joined once the user has logged in.
  234. You can either specify a simple list of room JIDs, in which case your nickname
  235. will be taken from your JID, or you can specify a list of maps, where each map
  236. specifies the room's JID and the nickname that should be used.
  237. For example::
  238. `[{'jid': 'room@example.org', 'nick': 'WizardKing69' }]`
  239. blacklisted_plugins
  240. -------------------
  241. * Default: ``[]`` (``['converse-minimize', 'converse-dragresize']`` for inVerse)
  242. A list of plugin names that are blacklisted and will therefore not be
  243. initialized once ``converse.initialize`` is called, even if the same plugin is
  244. whitelisted.
  245. From Converse.js 3.0 onwards most of the API is available only to plugins and
  246. all plugins need to be whitelisted first.
  247. The usecase for blacklisting is generally to disable removed core plugins
  248. (which are automatically whitelisted) to prevent other (potentially malicious)
  249. plugins from registering themselves under those names.
  250. The core, and by default whitelisted, plugins are::
  251. converse-bookmarks
  252. converse-chatview
  253. converse-controlbox
  254. converse-core
  255. converse-dragresize
  256. converse-headline
  257. converse-mam
  258. converse-minimize
  259. converse-muc
  260. converse-notification
  261. converse-otr
  262. converse-ping
  263. converse-register
  264. converse-rosterview
  265. converse-vcard
  266. An example from `the embedded room demo <https://conversejs.org/demo/embedded.html>`_
  267. .. code-block:: javascript
  268. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  269. converse.initialize({
  270. // other settings removed for brevity
  271. blacklisted_plugins: [
  272. 'converse-controlbox',
  273. 'converse-dragresize',
  274. 'converse-minimize',
  275. 'converse-vcard'
  276. ],
  277. });
  278. });
  279. .. _`bosh-service-url`:
  280. bosh_service_url
  281. ----------------
  282. * Default: ``undefined``
  283. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  284. connection manager which acts as a middle man between the HTTP and XMPP
  285. protocols.
  286. The bosh_service_url setting takes the URL of a BOSH connection manager.
  287. Please refer to your XMPP server's documentation on how to enable BOSH.
  288. For more information, read this blog post: `Which BOSH server do you need? <http://metajack.im/2008/09/08/which-bosh-server-do-you-need>`_
  289. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  290. Please see the :ref:`websocket-url` configuration setting.
  291. cache_otr_key
  292. -------------
  293. * Default: ``false``
  294. Let the `OTR (Off-the-record encryption) <https://otr.cypherpunks.ca>`_ private
  295. key be cached in your browser's session storage.
  296. The browser's session storage persists across page loads but is deleted once
  297. the tab or window is closed.
  298. If this option is set to ``false``, a new OTR private key will be generated
  299. for each page load. While more inconvenient, this is a much more secure option.
  300. This setting can only be used together with ``allow_otr = true``.
  301. .. note::
  302. A browser window's session storage is accessible by all javascript that
  303. is served from the same domain. So if there is malicious javascript served by
  304. the same server (or somehow injected via an attacker), then they will be able
  305. to retrieve your private key and read your all the chat messages in your
  306. current session. Previous sessions however cannot be decrypted.
  307. chatstate_notification_blacklist
  308. --------------------------------
  309. * Default: ``[]``
  310. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  311. Some user's clients routinely connect and disconnect (likely on mobile) and
  312. each time a chat state notificaion is received (``online`` when connecting and
  313. then ``offline`` when disconnecting).
  314. When desktop notifications are turned on (see `show-desktop-notifications`_),
  315. then you'll receive notification messages each time this happens.
  316. Receiving constant notifications that a user's client is connecting and disconnecting
  317. is annoying, so this option allows you to ignore those JIDs.
  318. connection_options
  319. ------------------
  320. * Default: ``{}``
  321. * Type: Object
  322. Converse.js relies on `Strophe.js <http://strophe.im>`_ to establish and
  323. maintain a connection to the XMPP server.
  324. This option allows you to pass a map of configuration options to be passed into
  325. the ``Strophe.Connection`` constructor.
  326. For documentation on the configuration options that ``Strophe.Connection``
  327. accepts, refer to the
  328. `Strophe.Connection documentation <http://strophe.im/strophejs/doc/1.2.8/files/strophe-js.html#Strophe.Connection.Strophe.Connection>`_.
  329. As an example, suppose you want to restrict the supported SASL authentication
  330. mechanisms, then you'd pass in the ``mechanisms`` as a ``connection_options``
  331. ``key:value`` pair:
  332. .. code-block:: javascript
  333. converse.initialize({
  334. connection_options: {
  335. 'mechanisms': [
  336. converse.env.Strophe.SASLMD5,
  337. ]
  338. },
  339. });
  340. .. _`credentials_url`:
  341. credentials_url
  342. ---------------
  343. * Default: ``null``
  344. * Type: URL
  345. This setting should be used in conjunction with ``authentication`` set to ``login`` and :ref:`keepalive` set to ``true``.
  346. It allows you to specify a URL which converse.js will call when it needs to get
  347. the username and password (or authentication token) which converse.js will use
  348. to automatically log the user in.
  349. If ``auto_reconnect`` is also set to true, then converse.js will automatically
  350. fetch new credentials from the ``credentials_url`` whenever the connection or
  351. session drops, and then attempt to reconnect and establish a new session.
  352. The server behind ``credentials_url`` should return a JSON encoded object::
  353. {
  354. "jid": "me@example.com/resource",
  355. "password": "Ilikecats!",
  356. }
  357. csi_waiting_time
  358. ----------------
  359. * Default: ``0``
  360. This option adds support for `XEP-0352 Client State Indication <http://xmpp.org/extensions/xep-0352.html>_`
  361. If converse.js is idle for the configured amount of seconds, a chat state
  362. indication of ``inactive`` will be sent out to the XMPP server (if the server
  363. supports CSI).
  364. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  365. a chat state indication of ``active`` will be sent out.
  366. A value of ``0`` means that this feature is disabled.
  367. debug
  368. -----
  369. * Default: ``false``
  370. If set to true, debugging output will be logged to the browser console.
  371. default_domain
  372. --------------
  373. * Default: ``undefined``
  374. Specify a domain to act as the default for user JIDs. This allows users to log
  375. in with only the username part of their JID, instead of the full JID.
  376. For example, if ``default_domain`` is ``example.org``, then the user
  377. ``johnny@example.org`` can log in with only ``johnny``.
  378. JIDs with other domains are still allowed but need to be provided in full.
  379. To specify only one domain and disallow other domains, see the `locked_domain`_
  380. option.
  381. registration_domain
  382. -------------------
  383. * Default: ``''``
  384. Specify a domain name for which the registration form will be fetched automatically,
  385. without the user having to enter any XMPP server domain name.
  386. default_state
  387. -------------
  388. * Default: ``'online'``
  389. The default chat status that the user wil have. If you for example set this to
  390. ``'chat'``, then converse.js will send out a presence stanza with ``"show"``
  391. set to ``'chat'`` as soon as you've been logged in.
  392. domain_placeholder
  393. ------------------
  394. * Default: ``e.g. conversejs.org``
  395. The placeholder text shown in the domain input on the registration form.
  396. emojione_image_path
  397. -------------------
  398. * Default: ``'https://cdn.jsdelivr.net/emojione/assets/' + emojioneVersion + '/png/'``
  399. When `use_emojione`_ is set to ``true``, then this is the URL from where PNG image files for
  400. displaying emojis will be fetched.
  401. expose_rid_and_sid
  402. ------------------
  403. * Default: ``false``
  404. Allow the prebind tokens, RID (request ID) and SID (session ID), to be exposed
  405. globally via the API. This allows other scripts served on the same page to use
  406. these values.
  407. *Beware*: a malicious script could use these tokens to assume your identity
  408. and inject fake chat messages.
  409. filter_by_resource
  410. ------------------
  411. * Default: ``false``
  412. Before version 1.0.3 converse.js would ignore received messages if they were
  413. intended for a different resource then the current user had. It was decided to
  414. drop this restriction but leave it configurable.
  415. forward_messages
  416. ----------------
  417. * Default: ``false``
  418. If set to ``true``, sent messages will also be forwarded to the sending user's
  419. bare JID (their Jabber ID independent of any chat clients aka resources).
  420. This means that sent messages are visible from all the user's chat clients,
  421. and not just the one from which it was actually sent.
  422. This is especially important for web chat, such as converse.js, where each
  423. browser tab functions as a separate chat client, with its own resource.
  424. This feature uses Stanza forwarding, see also `XEP 0297: Stanza Forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  425. For an alternative approach, see also `message_carbons`_.
  426. fullname
  427. --------
  428. If you are using prebinding, can specify the fullname of the currently
  429. logged in user, otherwise the user's vCard will be fetched.
  430. .. _`hide_muc_server`:
  431. hide_muc_server
  432. ---------------
  433. * Default: ``false``
  434. Hide the ``server`` input field of the form inside the ``Room`` panel of the
  435. controlbox. Useful if you want to restrict users to a specific XMPP server of
  436. your choosing.
  437. hide_offline_users
  438. ------------------
  439. * Default: ``false``
  440. If set to ``true``, then don't show offline users.
  441. hide_open_bookmarks
  442. -------------------
  443. * Default: ``false`` (``true`` for inVerse).
  444. This setting applies to the ``converse-bookmarks`` plugin and specfically the
  445. list of bookmarks shown in the ``Rooms`` tab of the control box.
  446. By default all bookmarks are shown in that list, if this setting is set to
  447. ``true``, then only bookmarks for rooms not currently open (i.e. that the
  448. current user hasn't joined), are shown.
  449. Makes sense to set this to ``true`` when also using the non-core
  450. ``converse-roomslist`` plugin, which shows a list of currently open (i.e.
  451. "joined") rooms.
  452. include_offline_state
  453. ---------------------
  454. * Default: `false`
  455. Originally, converse.js included an `offline` state which the user could
  456. choose (along with `online`, `busy` and `away`).
  457. Eventually it was however decided to remove this state, since the `offline`
  458. state doesn't propagate across tabs like the others do.
  459. What's meant by "propagate across tabs", is that when you set the state to
  460. `offline` in one tab, and you have instances of converse.js open in other tabs
  461. in your browser, then those instances will not have their states changed to
  462. `offline` as well. For the other statees the change is however propagated.
  463. The reason for this is that according to the XMPP spec, there is no `offline`
  464. state. The only defined states are:
  465. * away -- The entity or resource is temporarily away.
  466. * chat -- The entity or resource is actively interested in chattiIng.
  467. * dnd -- The entity or resource is busy (dnd = "Do Not Disturb").
  468. * xa -- The entity or resource is away for an extended period (xa = "eXtended Away").
  469. Read the `relevant section in the XMPP spec <https://xmpp.org/rfcs/rfc6121.html#presence-syntax-children-show>`_
  470. for more info.
  471. What used to happen in converse.js when the `offline` state was chosen, is
  472. that a presence stanza with a `type` of `unavailable` was sent out.
  473. This is actually exactly what happens when you log out of converse.js as well,
  474. with the notable exception that in the `offline` state, the connection is not
  475. terminated. So you can at any time change your state to something else and
  476. start chatting again.
  477. This might be useful to people, however the fact that the `offline` state
  478. doesn't propagate across tabs means that the user experience is inconsistent,
  479. confusing and appears "broken".
  480. If you are however aware of this issue and still want to allow the `offline`
  481. state, then you can set this option to `true` to enable it.
  482. .. _`i18n`:
  483. i18n
  484. ----
  485. * Default: Auto-detection of the User/Browser language or ``en``;
  486. Specify the locale/language.
  487. The translations for that locale must be available in JSON format at the
  488. `locales_url`_
  489. If an explicit locale is specified via the ``i18n`` setting and the
  490. translations for that locale are not found at the `locales_url``, then
  491. then Converse.js will fall back to trying to determine the browser's language
  492. and fetching those translations, or if that fails the default English texts
  493. will be used.
  494. jid
  495. ---
  496. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  497. on the XMPP network. It looks like an email address, but it's used for instant
  498. messaging instead.
  499. This value needs to be provided when using the :ref:`keepalive` option together
  500. with `prebind`_.
  501. .. _`keepalive`:
  502. keepalive
  503. ---------
  504. * Default: ``true``
  505. Determines whether Converse.js will maintain the chat session across page
  506. loads.
  507. This setting should also be used in conjunction with ``authentication`` set to `prebind`_.
  508. When using ``keepalive`` and ``prebind``, you will have to provide the `jid`_
  509. of the current user to ensure that a cached session is only resumed if it
  510. belongs to the current user.
  511. See also:
  512. * :ref:`session-support`
  513. .. note::
  514. Currently the "keepalive" setting only works with BOSH and not with
  515. websockets. This is because XMPP over websocket does not use the same
  516. session token as with BOSH. A possible solution for this is to implement
  517. `XEP-0198 <http://xmpp.org/extensions/xep-0198.html>`_, specifically
  518. with regards to "stream resumption".
  519. .. _`locales`:
  520. locales
  521. -------
  522. * Default:
  523. .. code-block:: javascript
  524. locales: [
  525. 'af', 'ca', 'de',
  526. 'es', 'en', 'fr',
  527. 'he', 'hu', 'id',
  528. 'it', 'ja', 'nb',
  529. 'nl', 'pl', 'pt_BR',
  530. 'ru', 'uk', 'zh'
  531. ]
  532. This setting restricts the locales that are supported by Converse.js and
  533. therefore what may be given as value for the :ref:`i18n` option.
  534. Any other locales will be ignored.
  535. When self-hosting, also make sure that the locales are served and therefore
  536. fetchable (via ``XMLHttpRequest``) at the URL specified by :ref:`locales-url`.
  537. .. _`locales-url`:
  538. locales_url
  539. -----------
  540. * Default: ``/locale/{{{locale}}}/LC_MESSAGES/converse.json``,
  541. The URL from where Converse.js should fetch translation JSON.
  542. The three curly braces ``{{{ }}}`` are
  543. `Mustache <https://github.com/janl/mustache.js#readme>`_-style
  544. variable interpolation which HTML-escapes the value being inserted. It's
  545. important that the inserted value is HTML-escaped, otherwise a malicious script
  546. injection attack could be attempted.
  547. The variable being interpolated via the curly braces is ``locale``, which is
  548. the value passed in to the `i18n`_ setting, or the browser's locale or the
  549. default local or `en` (resolved in that order).
  550. From version 3.3.0, Converse.js no longer bundles all translations into its
  551. final build file. Instead, only the relevant translations are fetched at
  552. runtime.
  553. This change also means that it's no longer possible to pass in the translation
  554. JSON data directly into ``_converse.initialize`` via the `i18n`_ setting.
  555. Instead, you only specify the language code (e.g. `de`) and that language's
  556. JSON translations will automatically be fetched via XMLHTTPRequest at
  557. ``locales_url``.
  558. locked_domain
  559. -------------
  560. * Default: ``undefined``
  561. Similar to `default_domain`_ but no other domains are allowed.
  562. For example, if ``locked_domain`` is set to ``example.org``, then the user
  563. ``johnny@example.org`` can log in with only ``johnny``.
  564. Additionally, only users registered on the ``example.org`` host can log in, no
  565. other users are allowed to log in.
  566. message_archiving
  567. -----------------
  568. * Default: ``undefined``
  569. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  570. whereby messages are archived in the XMPP server for later retrieval.
  571. Note, your XMPP server must support XEP-0313 MAM for this to work.
  572. This option sets the default archiving preference.
  573. Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
  574. ``undefined`` means that any existing MAM configuration, as set by the user or
  575. the server administrator, will be used.
  576. ``roster`` means that only messages to and from JIDs in your roster will be
  577. archived. The other two values are self-explanatory.
  578. message_archiving_timeout
  579. -------------------------
  580. * Default: ``8000``
  581. The amount of time (in milliseconds) to wait when requesting archived messages
  582. from the XMPP server.
  583. Used in conjunction with `message_archiving` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  584. message_carbons
  585. ---------------
  586. * Default: ``false``
  587. Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>`_
  588. In order to keep all IM clients for a user engaged in a conversation,
  589. outbound messages are carbon-copied to all interested resources.
  590. This is especially important in webchat, like converse.js, where each browser
  591. tab serves as a separate IM client.
  592. Both message_carbons and `forward_messages`_ try to solve the same problem
  593. (showing sent messages in all connected chat clients aka resources), but go about it
  594. in two different ways.
  595. Message carbons is the XEP (Jabber protocol extension) specifically drafted to
  596. solve this problem, while `forward_messages`_ uses
  597. `stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  598. message_storage
  599. ----------------
  600. * Default: ``session``
  601. Valid options: ``session``, ``local``.
  602. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  603. (``localStorage`` or ``sessionStorage``) used by converse.js to cache messages (private and group).
  604. The main difference between the two is that `sessionStorage` only persists while
  605. the current tab or window containing a converse.js instance is open. As soon as
  606. it's closed, the data is cleared.
  607. Data in `localStorage` on the other hand is kept indefinitely, which can have
  608. privacy implications on public computers or when multiple people are using the
  609. same computer.
  610. See also the `storage`_ option, which applies to other cached data, such as
  611. which chats you have open, what features the XMPP server supports and what
  612. your online status is.
  613. muc_disable_moderator_commands
  614. ------------------------------
  615. * Default: ``false``
  616. Allows you to disable the moderator commands such as ``/kick`` or ``/ban``.
  617. muc_domain
  618. ----------
  619. * Default: ``undefined``
  620. The MUC (multi-user chat) domain that should be used. By default converse.js
  621. will attempt to get the MUC domain from the XMPP host of the currently logged in
  622. user.
  623. This setting will override that. You might want to combine this setting with `hide_muc_server`_.
  624. muc_history_max_stanzas
  625. -----------------------
  626. * Default: ``undefined``
  627. This option allows you to specify the maximum amount of messages to be shown in a
  628. chatroom when you enter it. By default, the amount specified in the room
  629. configuration or determined by the server will be returned.
  630. Please note, this option is not related to
  631. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  632. which also allows you to show archived chatroom messages, but follows a
  633. different approach.
  634. If you're using MAM for archiving chatroom messages, you might want to set
  635. this option to zero.
  636. muc_instant_rooms
  637. ------------------
  638. * Default: ``true``
  639. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  640. Otherwise rooms first have to be configured before they're available to other
  641. users (so-called "registered rooms" in `MUC-0045 <http://xmpp.org/extensions/xep-0045.html#createroom>`_).
  642. From a UX perspective, if this settings is `false`, then a configuration form will
  643. render, that has to be filled in first, before the room can be joined by other
  644. users.
  645. muc_nickname_from_jid
  646. ---------------------
  647. * Default: ``false``
  648. When set to ``true``, then users will not be prompted to provide nicknames for
  649. chatrooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  650. will be used. If the user's nickname is already taken by another user in the
  651. chatroom, then an integer will be added to make it unique.
  652. So, for example, if john@example.com joins a chatroom, his nickname will
  653. automatically be "john". If now john@differentdomain.com tries to join the
  654. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  655. his nickname will be "john-3", and so forth.
  656. muc_show_join_leave
  657. -------------------
  658. * Default; ``true``
  659. Determines whether Converse.js will show info messages inside a chatroom
  660. whenever a user joins or leaves it.
  661. notify_all_room_messages
  662. ------------------------
  663. * Default: ``false``
  664. By default, sound and desktop notifications will only be made when you are
  665. mentioned in a room. If you set this setting to `true`, then you will be
  666. notified of all messages received in a room.
  667. You can also pass an array of room JIDs to this option, to only apply it to
  668. certain rooms.
  669. notification_icon
  670. -----------------
  671. * Default: ``'/logo/conversejs.png'``
  672. This option specifies which icon is shown in HTML5 notifications, as provided
  673. by the ``src/converse-notification.js`` plugin.
  674. ping_interval
  675. -------------
  676. * Default: ``180``
  677. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  678. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  679. You need to set the value to any positive value to enable this functionality.
  680. If you set this value to ``0`` or any negative value, il will disable this functionality.
  681. .. _`play-sounds`:
  682. play_sounds
  683. -----------
  684. * Default: ``false``
  685. Plays a notification sound when you receive a personal message or when your
  686. nickname is mentioned in a chatroom.
  687. Inside the ``./sounds`` directory of the Converse.js repo you'll see MP3 and Ogg
  688. formatted sound files. We need both, because neither format is supported by all browsers.
  689. You can set the URL where the sound files are hosted with the `sounds_path`_
  690. option.
  691. Requires the `src/converse-notification.js` plugin.
  692. .. _`prebind_url`:
  693. prebind_url
  694. -----------
  695. * Default: ``null``
  696. * Type: URL
  697. See also: :ref:`session-support`
  698. This setting should be used in conjunction with ``authentication`` set to `prebind` and :ref:`keepalive` set to ``true``.
  699. It allows you to specify a URL which converse.js will call when it needs to get
  700. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  701. converse.js will then attach to.
  702. The server behind ``prebind_url`` should return a JSON encoded object with the
  703. three tokens::
  704. {
  705. "jid": "me@example.com/resource",
  706. "sid": "346234623462",
  707. "rid": "876987608760"
  708. }
  709. priority
  710. --------
  711. * Default: ``0``
  712. * Type: Number
  713. Determines the priority used for presence stanzas sent out from this resource
  714. (i.e. this instance of Converse.js).
  715. The priority of a given XMPP chat client determines the importance of its presence
  716. stanzas in relation to stanzas received from other clients of the same user.
  717. In Converse.js, the indicated chat status of a roster contact will be taken from the
  718. presence stanza (and associated resource) with the highest priority.
  719. If multiple resources have the same top priority, then the chat status will be
  720. taken from the most recent present stanza.
  721. For more info you can read `Section 2.2.2.3 of RFC-3921 <https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.3>`_.
  722. providers_link
  723. --------------
  724. * Default: ``https://xmpp.net/directory.php``
  725. The hyperlink on the registration form which points to a directory of public
  726. XMPP servers.
  727. root
  728. ----
  729. * Default: ``window.document``
  730. When using converse.js inside a web component's shadow DOM, you will need to set this settings'
  731. value to the shadow-root of the shadow DOM.
  732. For example:
  733. .. code-block:: javascript
  734. class CustomChatComponent extends HTMLElement {
  735. constructor() {
  736. super();
  737. const shadowRoot = this.attachShadow({mode: "open"});
  738. this.initConverse(shadowRoot);
  739. }
  740. initConverse(shadowRoot) {
  741. window.addEventListener("converse-loaded", function(event) {
  742. converse.initialize({
  743. root: shadowRoot,
  744. // Other settings go here...
  745. });
  746. });
  747. }
  748. }
  749. roster_groups
  750. -------------
  751. * Default: ``false``
  752. If set to ``true``, converse.js will show any roster groups you might have
  753. configured.
  754. .. note::
  755. It's currently not possible to use converse.js to assign contacts to groups.
  756. Converse.js can only show users and groups that were previously configured
  757. elsewhere.
  758. show_chatstate_notifications
  759. ----------------------------
  760. * Default: ``false``
  761. Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
  762. show_controlbox_by_default
  763. --------------------------
  764. * Default: ``false`` (``true`` for inVerse)
  765. The "controlbox" refers to the special chatbox containing your contacts roster,
  766. status widget, chatrooms and other controls.
  767. By default this box is hidden and can be toggled by clicking on any element in
  768. the page with class *toggle-controlbox*.
  769. If this options is set to true, the controlbox will by default be shown upon
  770. page load.
  771. However, be aware that even if this value is set to ``false``, if the
  772. controlbox is open, and the page is reloaded, then it will stay open on the new
  773. page as well.
  774. .. _`show-desktop-notifications`:
  775. show_desktop_notifications
  776. --------------------------
  777. * Default: ``true``
  778. Should HTML5 desktop notifications be shown?
  779. Notification will be shown in the following cases:
  780. * the browser is not visible nor focused and a private message is received.
  781. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  782. * `auto_subscribe` is set to `false` and a new contact request is received.
  783. Requires the `src/converse-notification.js` plugin.
  784. use_emojione
  785. ------------
  786. * Default: ``true``
  787. Determines whether `Emojione <https://www.emojione.com/>`_ should be used to
  788. render emojis. If set to ``false``, then rendering support will fall back to
  789. the operating system or browser (which might not support emoji).
  790. See also `emojione_image_path`_.
  791. show_message_load_animation
  792. ---------------------------
  793. * Default: ``false``
  794. Determines whether a CSS3 background-color fade-out animation is shown when messages
  795. appear in chats.
  796. Set to ``false`` by default since this option causes performance issues on Firefox.
  797. show_only_online_users
  798. ----------------------
  799. * Default: ``false``
  800. If set to ``true``, only online users will be shown in the contacts roster.
  801. Users with any other status (e.g. away, busy etc.) will not be shown.
  802. show_send_button
  803. ----------------------
  804. * Default: ``false``
  805. If set to ``true``, a button will be visible which can be clicked to send a message.
  806. sounds_path
  807. -----------
  808. * Default: ``/sounds/``
  809. This option only makes sense in conjunction with the `play_sounds`_ option and
  810. specifies the URL of the sound files to be played (exluding the file names
  811. themselves).
  812. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  813. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  814. storage
  815. -------
  816. * Default: ``session``
  817. Valid options: ``session``, ``local``.
  818. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  819. (``localStorage`` or ``sessionStorage``) used by converse.js to cache user data.
  820. Originally converse.js used only `localStorage`, however `sessionStorage` is from a
  821. privacy perspective a better choice.
  822. The main difference between the two is that `sessionStorage` only persists while
  823. the current tab or window containing a converse.js instance is open. As soon as
  824. it's closed, the data is cleared.
  825. Data in `localStorage` on the other hand is kept indefinitely.
  826. The data that is cached includes which chats you had open, what features the
  827. XMPP server supports and what your online status was.
  828. Since version 1.0.7, the store for messages is now configurable separately with
  829. the `message_storage`_ option, to allow you to cache messages for longer in the
  830. browser (with `localStorage`) while still using `sessionStorage` for other
  831. data.
  832. .. note::
  833. Between versions 0.8.0 and 1.0.7, setting the value of this option to "local"
  834. is not recommended. The statuses (online, away, busy etc.) of your roster
  835. contacts are cached in the browser storage. If you use local storage, these
  836. values are stored for multiple sessions, and they will likely become out of
  837. sync with your contacts' actual statuses. The session storage doesn't have
  838. this problem, because roster contact statuses will not become out of sync in
  839. a single session, only across more than one session.
  840. Since version 1.0.7, the "storage" option doesn't apply anymore to how roster
  841. contacts and their statuses are stored (they're now always stored in session
  842. storage), to address the above issue.
  843. sticky_controlbox
  844. -----------------
  845. * Default: ``false`` (``true`` for inVerse).
  846. If set to ``true``, the control box (which includes the login, registration,
  847. contacts and rooms tabs) will not be closeable. It won't have a close button at
  848. all.
  849. The idea behind this setting is to provide a better experience on mobile
  850. devices when the intent is to use converse.js as a web app. In this case
  851. it doesn't make sense to close the control box, as there's often then nothing
  852. "behind" it that's relevant to the user.
  853. .. _`strict_plugin_dependencies`:
  854. strict_plugin_dependencies
  855. --------------------------
  856. * Default: ``false``
  857. When set to ``true`` and a plugin tries to override an object which doesn't
  858. exist (for example because the plugin which provides that object is not
  859. loaded), then an error will be raised.
  860. Otherwise a message will simply be logged and the override instruction ignored.
  861. The Converse.js plugins architecture can have an :ref:`dependencies`
  862. plugin attribute. This enables you to specify an array of other plugins which
  863. this one depends on.
  864. Converse.js (more specifically, `pluggable.js <https://jcbrand.github.io/pluggable.js/>`_)
  865. will first load these dependencies before executing the plugin's overrides and
  866. calling its ``initialize`` method.
  867. This is especially important if you register event handlers in your plugin for
  868. events that fire in other plugins. In this case, you want to specify those
  869. other plugins as dependencies.
  870. If ``strict_plugin_dependencies`` is set to ``false``, an error won't be raised
  871. if the optional dependencies aren't found.
  872. synchronize_availability
  873. ------------------------
  874. * Default: ``true``
  875. Valid options: ``true``, ``false``, ``a resource name``.
  876. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  877. if you change your status to `busy` in a different chat client, your status will change to `busy` in converse.js as well.
  878. If set to ``true``, converse.js will synchronize with all other clients you are logged in with.
  879. If set to ``false``, this feature is disabled.
  880. If set to ``a resource name``, converse.js will synchronize only with a client that has that particular resource assigned to it.
  881. time_format
  882. -----------
  883. * Default: ``HH:mm``
  884. Examples: ``HH:mm``, ``hh:mm``, ``hh:mm a``.
  885. This option makes the time format for the time shown, for each message, configurable. Converse uses `moment.js <https://momentjs.com/>`_
  886. for showing time. This option allows the configuration of the format in which `moment` will display the time for the messages. For detailed
  887. description of time-format options available for `moment` you can check this `link <https://momentjs.com/docs/#/parsing/string-format/>`_.
  888. use_otr_by_default
  889. ------------------
  890. * Default: ``false``
  891. If set to ``true``, Converse.js will automatically try to initiate an OTR (off-the-record)
  892. encrypted chat session every time you open a chatbox.
  893. use_vcards
  894. ----------
  895. * Default: ``true``
  896. Determines whether the XMPP server will be queried for roster contacts' VCards
  897. or not. VCards contain extra personal information such as your fullname and
  898. avatar image.
  899. visible_toolbar_buttons
  900. -----------------------
  901. * Default:
  902. .. code-block:: javascript
  903. {
  904. call: false,
  905. clear: true,
  906. emoji: true,
  907. toggle_occupants: true
  908. }
  909. Allows you to show or hide buttons on the chatboxes' toolbars.
  910. * *call*:
  911. Provides a button with a picture of a telephone on it.
  912. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.
  913. .. code-block:: javascript
  914. converse.listen.on('callButtonClicked', function(data) {
  915. console.log('Strophe connection is', data.connection);
  916. console.log('Bare buddy JID is', data.model.get('jid'));
  917. // ... Third-party library code ...
  918. });
  919. * *clear*:
  920. Provides a button for clearing messages from a chatbox.
  921. * *emoji*:
  922. Enables rendering of emoji and provides a toolbar button for choosing them.
  923. * *toggle_occupants*:
  924. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chatroom.
  925. .. _`websocket-url`:
  926. websocket_url
  927. -------------
  928. * Default: ``undefined``
  929. This option is used to specify a
  930. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  931. converse.js can connect to.
  932. Websockets provide a more modern and effective two-way communication protocol
  933. between the browser and a server, effectively emulating TCP at the application
  934. layer and therefore overcoming many of the problems with existing long-polling
  935. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  936. Please refer to your XMPP server's documentation on how to enable websocket
  937. support.
  938. .. note::
  939. Please note that not older browsers do not support websockets. For older
  940. browsers you'll want to specify a BOSH URL. See the :ref:`bosh-service-url`
  941. configuration setting).
  942. .. note::
  943. Converse.js does not yet support "keepalive" with websockets.
  944. .. _`view_mode`:
  945. view_mode
  946. ---------
  947. * Default: ``overlayed``
  948. * Allowed values: ``overlayed``, ``fullscreen``, ``mobile``, ``embedded``
  949. The ``view_mode`` setting configures converse.js's mode and resulting behavior.
  950. Before the introduction of this setting (in version 3.3.0), there were there
  951. different builds, each for the different modes.
  952. These were:
  953. * ``converse-mobile.js`` for the ``mobile`` mode
  954. * ``converse-muc-embedded.js`` for embedding a single MUC room into the page.
  955. * ``converse.js`` for the ``overlayed`` mode
  956. * ``inverse.js`` for the ``fullscreen`` mode
  957. Besides having different builds, certain plugins had to be whitelisted
  958. and blacklisted for the different modes.
  959. ``converse-singleton`` had to be whitelisted for the ``mobile`` and ``fullscreen``
  960. modes, additionally ``converse-inverse`` had to be whitelisted for the
  961. ``fullscreen`` mode.
  962. For both those modes the ``converse-minimize`` and ``converse-dragresize``
  963. plugins had to be blacklisted.
  964. When using ``converse-muc-embedded.js`` various plugins also had to manually be
  965. blacklisted.
  966. Since version 3.3.0 it's no longer necessary to blacklist any plugins (except
  967. for ``converse-muc-embedded.js``, which is from version 3.3.3).
  968. Blacklisting now happens automatically.
  969. Since version 3.3.0, the ``inverse.js`` and ``converse-mobile.js`` builds no
  970. longer exist. Instead the standard ``converse.js`` build is used, together with
  971. the appropriate ``view_mode`` value.
  972. The ``converse-muc-embedded.js`` build is still kept, because it's smaller than
  973. ``converse.js`` due to unused code being removed. It doesn't however contain
  974. any new code, so the full ``converse.js`` build could be used instead, as long
  975. as ``view_mode`` is set to ``embedded``.
  976. Furthermore, it's no longer necessary to whitelist or blacklist any plugins
  977. when switching view modes.
  978. .. note::
  979. Although the ``view_mode`` setting has removed the need for different
  980. JavaScript builds, you'll still need to use different CSS files depending
  981. on the view mode.
  982. * For ``overlayed`` this is ``./css/converse.css``
  983. * For ``fullscreen`` you need ``./css/inverse.css``
  984. * For ``mobile`` you need to use both ``./css/converse.css`` and ``./css/mobile.css``
  985. Hopefully in a future release the CSS files will be combined and you'll
  986. only need ``converse.css``
  987. .. _`whitelisted_plugins`:
  988. whitelisted_plugins
  989. -------------------
  990. * Default: ``[]``
  991. A list of plugin names that are whitelisted and will therefore be
  992. initialized once ``converse.initialize`` is called.
  993. From Converse.js 3.0 onwards most of the API is available only to plugins and
  994. all plugins need to be whitelisted first.
  995. This is done to prevent malicious scripts from using the API to trick users or
  996. to read their conversations.
  997. By default all the core plugins are already whitelisted.
  998. These are::
  999. converse-bookmarks
  1000. converse-chatview
  1001. converse-controlbox
  1002. converse-core
  1003. converse-dragresize
  1004. converse-headline
  1005. converse-mam
  1006. converse-minimize
  1007. converse-muc
  1008. converse-notification
  1009. converse-otr
  1010. converse-ping
  1011. converse-register
  1012. converse-rosterview
  1013. converse-vcard
  1014. If you are using a custom build which excludes some core plugins, then you
  1015. should blacklist them so that malicious scripts can't register their own
  1016. plugins under those names. See `blacklisted_plugins`_ for more info.
  1017. An example from `the embedded room demo <https://conversejs.org/demo/embedded.html>`_
  1018. .. code-block:: javascript
  1019. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  1020. converse.initialize({
  1021. // other settings removed for brevity
  1022. whitelisted_plugins: ['converse-muc-embedded']
  1023. });
  1024. });