Utilizzo della modalità sicura per risolvere problemi con temi e plugin

:bookmark: This guide explains how to use Discourse’s Safe Mode to troubleshoot issues with themes and plugins.

:person_raising_hand: Required user level: All users

Discourse offers a “JavaScript Safe Mode” that allows any user to isolate the root cause of JavaScript issues caused by plugins, themes, or theme components. This feature is particularly useful for troubleshooting problems on your Discourse site.

Accessing Safe Mode

To access Safe Mode, follow these steps:

  1. Open a new browser tab.

  2. Enter the following URL in the address bar, replacing [your-site-name](http://discourse.example.com) with your actual Discourse site domain:

    http://discourse.example.com/safe-mode
    

    For example, the Safe Mode URL for the Discourse demo site is:
    https://try.discourse.org/safe-mode

  3. Click the ‘Enter Safe Mode’ button:

Safe Mode options

When entering Safe Mode, you can select from the following options:

  • Disable all themes and theme components
  • Disable unofficial plugins
  • Disable all plugins

By default, all three options are selected. However, you can enter Safe Mode multiple times with different combinations to isolate the specific component causing issues on your site.

Using Safe Mode

  1. Select the desired options on the Safe Mode page.
  2. Click “Enter Safe Mode” to apply your selections.
  3. You will see a banner indicating that Safe Mode is enabled.
  4. Browse your site to check if the issue persists with the selected components disabled.

Exiting Safe Mode

To exit Safe Mode, simply close your browser tab.

Important notes

When sharing a Safe Mode link for your site, be aware that it needs to be opened in a new tab or added directly to the address bar; otherwise, it may not work correctly.

:warning: Safe Mode currently only disables the JavaScript portions of plugins. To disable the server-side portion of a plugin, you must rebuild your container with the plugin commented out.

Troubleshooting

If you cannot load the initial Safe Mode selection page, try visiting the following URL, which will skip the page and load Safe Mode directly:

https://discourse.example.com/?safe_mode=no_themes,no_plugins

For example: https://try.discourse.org/?safe_mode=no_themes,no_plugins

:information_source: On Discourse versions 2.9.0.beta8 and below, you need to use ?safe_mode=no_custom,no_plugins instead.

Last edited by @hugh 2024-07-30T05:32:08Z

Check documentPerform check on document:
73 Mi Piace

In qualche modo, per me quei link funzionano solo quando li apro in una nuova scheda o finestra. Il primo porta alla pagina oops e il secondo alla homepage. Ma il banner della modalità sicura non appare. Il secondo può causare problemi quando invii un link a un utente per fargli provare la modalità sicura. Se cliccano semplicemente sul link, utilizzeranno comunque il sito senza la modalità sicura.

Forse queste informazioni dovrebbero essere aggiunte a how-to.

4 Mi Piace

Ottima osservazione: entrambi i link sono rotti. Il primo necessita di un ? e il secondo di una virgola al posto di %2C

2 Mi Piace

Dove serve un “?”?
Potresti condividere il link come esempio?

1 Mi Piace

Oh, mi dispiace, sembra che mi sia sbagliato sulla prima: la navigazione interna fallisce, ma per una nuova finestra funziona.
Discourse Meta

E mi sbaglio anche sull’altro! Discourse Meta - The Official Support Forum for Discourse
non funziona come navigazione nella stessa pagina.

Mi scuso: qualcosa non va, ma non sono gli URL.

1 Mi Piace

Penso che sia perché sta cercando di aprirli sul posto. Piuttosto che discutere con esso, li ho sostituiti con try.discourse.org. :slight_smile:

2 Mi Piace

Penso che in qualche modo gli amministratori debbano comunque essere informati che la condivisione di tali link può facilmente essere un problema.

Ad esempio, segnalo un problema su meta. Potresti chiedere: “Potresti provare https://meta.discourse.org/safe-mode?” Quindi ti direi che il link non funziona.
O ancora peggio: vuoi specificare che disabilito solo i temi, quindi mi chiedi di provare https://meta.discourse.org/?safe_mode=no_themes. Il mio problema esiste ancora. Come fai a sapere se ho davvero usato la modalità sicura? Come utente, penso che abbia funzionato perché è successo qualcosa quando ho cliccato sul link.

Dopo che ho postato qui, ne sei a conoscenza. Ma come fanno gli altri amministratori a sapere che devono prestare attenzione al fatto che questo potrebbe essere un problema?

3 Mi Piace

Mi chiedo, data la natura di questa home page sicura visualizzata (che sostituisce tutto il contenuto), se si dovrebbe fare un’eccezione per aprire questo link in una nuova scheda.

2 Mi Piace

Ho aggiunto una nota e anche uno screenshot di uno ‘riuscito’. Come ti sembra?

4 Mi Piace

3 messaggi sono stati divisi in un nuovo argomento: Should safe mode be default off for non-staff users?