Usando o Modo de Segurança para solucionar problemas com temas e plugins

:bookmark: Este guia explica como usar o Modo Seguro do Discourse para solucionar problemas com temas e plugins.

:person_raising_hand: Nível de usuário necessário: Todos os usuários

O Discourse oferece um “Modo Seguro de JavaScript” que permite a qualquer usuário isolar a causa raiz de problemas de JavaScript causados por plugins, temas ou componentes de tema. Este recurso é particularmente útil para solucionar problemas no seu site Discourse.

Acessando o Modo Seguro

Para acessar o Modo Seguro, siga estas etapas:

  1. Abra uma nova aba do navegador.

  2. Insira a seguinte URL na barra de endereços, substituindo [your-site-name](http://discourse.example.com) pelo domínio real do seu site Discourse:

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

    Por exemplo, a URL do Modo Seguro para o site de demonstração do Discourse é:
    https://try.discourse.org/safe-mode

  3. Clique no botão ‘Entrar no Modo Seguro’:

Opções do Modo Seguro

Ao entrar no Modo Seguro, você pode selecionar as seguintes opções:

  • Desativar temas e componentes de tema
  • Desativar personalizações de plugins não oficiais no lado do cliente
  • Desativar todas as personalizações de plugins no lado do cliente
  • Fazer com que avisos de depreciação do JavaScript gerem um erro

Por padrão, as três primeiras opções estão selecionadas. A opção de erros de depreciação está desmarcada por padrão e é principalmente útil para desenvolvedores de plugins e temas que testam a compatibilidade com futuras atualizações do Discourse. Você pode entrar no Modo Seguro várias vezes com diferentes combinações para isolar o componente específico que está causando problemas no seu site.

Usando o Modo Seguro

  1. Selecione as opções desejadas na página do Modo Seguro.
  2. Clique em “Entrar no Modo Seguro” para aplicar suas seleções.
  3. Você verá um banner indicando que o Modo Seguro está ativado.
  4. Navegue pelo seu site para verificar se o problema persiste com os componentes selecionados desativados.

Saindo do Modo Seguro

Para sair do Modo Seguro, basta fechar a aba do seu navegador.

Observações importantes

Ao compartilhar um link do Modo Seguro para o seu site, esteja ciente de que ele precisa ser aberto em uma nova aba ou adicionado diretamente à barra de endereços; caso contrário, pode não funcionar corretamente.

:warning: O Modo Seguro atualmente desativa apenas as partes de JavaScript dos plugins. Para desativar a parte do servidor de um plugin, você deve reconstruir seu contêiner com o plugin comentado.

Solução de problemas

Se você não conseguir carregar a página inicial de seleção do Modo Seguro, tente visitar a seguinte URL, que ignorará a página e carregará o Modo Seguro diretamente:

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

Por exemplo: https://try.discourse.org/?safe_mode=no_themes,no_plugins

Os valores disponíveis do parâmetro de consulta safe_mode são: no_themes, no_unofficial_plugins, no_plugins e deprecation_errors. Estes podem ser combinados com vírgulas.

73 curtidas
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
502 and then empty forum after `./launcher rebuild app`
Upgraded last night and login button no longer works
Content of messages not showing up
Uncaught Errors
Topic Preview Broken (due to Google PageSpeed Module)
"About" pages crashing our Discourse
Manually Clear DistributedCache
Browser too old message when "compatibility mode" is forced in IE 11
Admin Plugin page is blank - Error: There is no route named adminPlugins.index
My site just broke after restarting server
After Recent Upgrade to 1.08? beta - No forum shows
Blank topics after import?
Problems clicking topic links in IE11
Website looks different on different browsers
How to disable a component without access to site?
Cannot create new topics (already disabled plugins)
Scrolling posts "jumps" back up when reaching end
How to increase site speed
Disable plugins without restarting?
A "safe mode" to easily disable all third party plugins
Discourse and Uncaught ReferenceError: ClipboardJS is not defined
Beginner's guide to using Discourse Themes
Global notice doesn’t show
Incorrect initial order when user sorts topic list
Unable to expand profile
Disable plugin without downtime?
Like button does not work on archived topics
Mobile Header expanding after tapping hamburger menu
Discourse 2.3.0.beta10 Release Notes
Lightbox not showing up on uploaded images after update
Vimeo onebox not working
Pasting tables from spreadsheets no longer working after 2.3 upgrade
Contains_dtoc in Grey Amber theme header
Site fails to load with js errors
No content displayed on front category page after upgrade
Notifications are acting strange
Occasional page loads with no post content due to plugins
Discourse 2.5.0.beta2 Release Notes
LDAP Setup for Discourse
Unable to add/edit tags
Unable to add/edit tags
Category unlike any other category
Unable to save wiki update
Infinite scroll not working in "Latest" on Mobile
Disappearing posts in 2.1.0.beta2
Post content not showing up
In-post links to topics - no longer update to the initial posts title
Issue with menu, admin
Excerpts truncating at 50 characters
How to change default Discourse theme via CLI?
Rtl direction is broken in quotes
Mentions reported wrongly as replies in notifications list
Bad JS customizations - how to fix in the backend?
User Notes plugin is breaking my site
Send Invites button should not be visible if local logins are disabled
Fields overlay text in login
Blank page after theme installation
Topic-footer buttons are disappearing
Blank pages, 500 errors and no logs
[2.1.0b6] New topic button is moving behind burger on click
Google, Twitter and Facebook Logins not working due to ad blocker
Can't See Posts When Logged Out
After latest admin/upgrade my Admin dashboard won't load
My install was broken because I upgraded but did not upgrade plugins
Bulk edit icon not showing?
Quoting is not working anymore
Some user see a blank page when opening a topic
Error occurs when clicking on the user profile picture within the post
Admin Trouble Creating a Category
Browser Back Button issue
Topic mismatch troubleshooting
Edit icon not activating after edits
I don't see the staff wrench on posts
Forum does not work for users on iOS
Category autocomplete stopped working on our site?
UI not loading after git pull update
Chat problem on mobile devices with 3.1.0beta5
Gui for querying category of solved or unsolved topics
Image displayed incorrectly on Mobile due to theme settings
Preview of post not loading because force https was not set
After updating to "2.9.0.beta1", the number of clicks on the image URL is not counted
Reordering Categories Produces Error 422
Limit on Number of Child Categories?
Password reset landing page not loading because of cloudflare rocketloader
Issue in user summary
Lightbox for images comes by default?
Updated discourse and now site fails to display
Updated discourse and now site fails to display
Having an issue with images' width getting cut off on desktop
Issue with the page title in Arabic?
Latest update broke my forum
Clicking on a category doesn't filter the right topics
Registration modal/popup not showing up for private instance
Iframes Not Working
Discourse unresponsive in Chrome
Direct links not loading for certain users, detailed explanation included
Topics tagged with `info` have strange appearance
Missing scroll bar slider, in Finnish Localization
Server errors in 2.5.0.beta3
Deleting group with 404 error
Multi-site upgrade leaves _some_ sites unavailable
Logins redirects to missing notifications page
Discourse broken after upgrade
Topic Will Close A Few Seconds After The Last Reply
Category drop down not truncating ... for longer category names
Usercard Redesign Experiment
Issues with index page infinite scrolling?
How might we better structure #howto?
Plugin page not loading unless I hard refresh (Chrome)
Plugin page not loading unless I hard refresh (Chrome)
Featured Tiles
Redis Problems? (Forum broken after upgrade)
Hashtags with numbers in parentheses appearing everywhere on Discourse site
After updating to 2.8.0.beta8, nothing shows as "read" anymore
Breaking Mobile view check after Discourse update to 2.5.0.beta7
Bug with access to public topic without login 3.1.0.beta2
Dashboard empty since upgradeto 2.5.0
Can’t create new category
Login form missing entirely from Discourse instance
Category link failed after updating today
Weird Formatting Bug in old Microsoft Edge
Blank website after update
Content won't load after update
Category link failed after updating today
Error 500 on category page and homepage after upgrade to 2.6
Mouse click is not working in my forum after recent update
Screen black out bug on modal
Social share components do not appear
Admin panel does not work
Totally blank upgrades page
Accidentally overwrote application.hbs || Enter safe mode
My Discourse site is not loading due to misconfigured CSP
Latest beta update (2.7.0b7) gone wrong
Some topic category boxes are missing
Need help reverting forums. I made a mistake
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return
Can not access Discourse - blank page
Topic replies are not displaying in chronological order?
Site broken after update
The "Save Changes" button is very low on my user preferences interface page
Problems when logging in as admin
Problems when logging in as admin
Phantom signups (two users with the same account after migration)
Composer overflows when open
Homepage (sub)category display - lots of whitespace
Category Image Formatting
Homepage (sub)category display - lots of whitespace
Update problem help pls
Restarted VM; now `/admin/upgrade` page fails to load, JS requests fail, some avatar images 404ing
Bug on topic interface after an update || Resolved
Scroll jank when scrolling up
504 Gateway Timeout for some reports
Trust level 1 users cannot Invite
Error: Something went wrong - "Error while processing route: discovery.categories"
Loading groups gives internal server error
UI not rendering in Chrome/Firefox due to CloudFlare rocket loader
Private Message Can't Be Reached with private messaging disabled
Sidebar has disappeared
[2.7.11] tags notifications dont work anymore for regular profil
My Discourse Forum can't display images
Upgrade page empty
Problem with displaying personal messages in Dark
Can't rebuild due to theme errors
Can't rebuild due to theme errors
Application crash due to invalid imports
Width of page causes an autoscroll to the top of the page when accessing serach/user/hamburger comboboxes (chrome only)
Jittery scrolling behavior
"Add required tag group" not working for a new category
Search Bar pops up when adding new topic or replying
Search Bar pops up when adding new topic or replying
Scrolling posts "jumps" back up when reaching end
iOS desktop view on ipad shaking at bottom of topics after zooming
"Watched words" review queue seems broken
Error: Can't access property "registerAsyncHelper"
Hamburger menu not showing on mobile?
Pasting a Youtube playlist link in the title doesn't fill the title and post content
Lightbox not working on Discourse
Lightbox not working on Discourse
Category image upload stops at 0%
Iframes Not Working
Polls broken after update
Polls broken after update
User preference persists through Safe Mode
User preference persists through Safe Mode
Updating / Rebuilding Discourse to latest version irreversibly breaks website
Updated discourse and now my spacing is off
Hamburger menu not showing on mobile?
Hide who's replying to this topic
Mobile view editor cog dropdown issue
How many category moderators are shown on about page?
How many category moderators are shown on about page?
MathJax plugin is not working. Safe mode works. Workaround, disable MathJax plugin
Category logo image overlaid by text after recent update
Post Preview not working because of events plugin
Site not loading and breaking after doing upgrade from admin UI due to theme errors
The "Hide Details" feature doesn't show up correctly in the preview window
Category missing (only showing posts per month) when not logged in
Unable to create categories - No creation button for admin or moderator
TypeError: Cannot read property 'id' of undefined
Text editor is not working in Firefox 78?
Prevent anons from downloading files incompatible with CDN
What on earth is causing this?
Composer does not work properly when repling on Firefox
"all categories" button and "open draft" button outline is weird
IP Lookup UI is broken
While loading a new component on the site, the site is down
IP Lookup UI is broken
"Review" disappeared from top-level menu
Pop up - how to css?
Error occurs when clicking on the user profile picture within the post
The composer gets stuck under the header if dragged too far up
Server reboot necessitates disco container reboot
Plugins not visible on /admin/plugins
User info pop-up disappears
Published page not visible?
After restoring a backup, discourse is 'loading...' and broke
Staff having trouble accessing deleted posts via the counter link at the top of user profiles
Are there updated directions for moving posts?
Are there updated directions for moving posts?
Accidentily deleted the main sidebar section
Discobot didn't recognize link in tutorial
No Gear Icon Menu for Moderator [iPad]
Code Highlighting with Escaped Quotes
CMYK scheme in Consolidated Pageviews graph
Inserting Javascript yields 403 error
Topic hangs on mobile
Add site setting to not show "Invited by" on user profiles
Bulk Action ‘Append Tags’ not working when tags are restricted
Bulk Action ‘Append Tags’ not working when tags are restricted
Our discourse overload because of a custom plugin. Please help me
Issues with site on Linode because domain’s registration had expired
About the user fields arrangement problem
My forum is stuck on the loading screen
Safe-mode failed with a plugin
Minimize-Close Button Missing
No Profile Header or User Card Background in /preference/profile?
No Profile Header or User Card Background in /preference/profile?
How to create a theme which only administrators can use?
Build Poll is not shown from gear menu for new topics
After upgrading to discourse 3.. can only access to admin using safe-mode
System account login
System account login
How can I enable: Auto-hyperlinking text to reference to other posts?
How can I enable: Auto-hyperlinking text to reference to other posts?
Clipboard copy from theme text editor only copies about a one and half lines of text
Infinite scroll does not work on All Categories page
Svg mobile logo scales incorrectly
Notification issues
I have added some js code to themes head-tag from backend. I want to delete the code but cant accees backend now
Granting custom badges is not working
"Unlikable" posts can be liked using keyboard navigation
Error when trying to view "Your Votes" with Topic Voting plugin
User cards for anonymous visitors immediately dissappear with "500 Internal Server Error" in `card.json?include_post_count_for`
BBCode `url` tags break if wrapped text ends in URL with component after host
Create account window squished
I cant see bulk actions in my discourse installation after selecting items
If a Wiki post is editable by non-staff, shouldn't there be an option to allow those who can edit the post to see all the edits to it?
Javascript alert/popup message when entering site
Fedoras Discourse instance made some troubles. Could the support please give some feedback
Add Preference for sidebar vertical scroll
Minimizing Maintenance on Theme Customizations
"Like this post" not available for some categories
Clipboard copy from theme text editor only copies about a one and half lines of text
Search no longer works after 3.1.0.beta1 update
Discourse not launching after upgrade
Streamable - whole file is downloaded on mobile version
Streamable - whole file is downloaded on mobile version
Drag'n drop cause crash browser tab
Reports is not loading
Composer previews not working in Safari
Notification bubble missing from top right profile pic
Cursor jumping around in composer / editor text box
Cursor jumping around in composer / editor text box
Error: Users can't make new accounts
Cursor jumping around in composer / editor text box
Save Category does not work in Categories setting
Cursor jumping around in composer / editor text box
Hide topic timeline
Modal headers - seeing double
Direct links not loading for certain users, detailed explanation included
How to customize the dashboard?
Discourse's CSS variables aren't set
Discourse's CSS variables aren't set
Forum stuck on the loading home screen
Forum stuck on the loading home screen
The bulk tools for PMs have been removed after last update
Avatar in rtl website in wrong place
Announcements posts are deleted... won't undelete
“New topic” button working incorrectly
Forum stuck on the loading home screen
Profile picture (avatar) and site setting uploads are not working
Provide option to choose showing full names in chat
Cannot see take action options on mobile
Chat button on usercard
Broken width responsive mobile
Our PMs stopped working
What Themes are being used for these Discourse forums?
No keyboard when adding tags while editing a topic
Login popup not display
Blank entry in recent searches
MacOs users on old version can´t read posts
Category is missing from latest
Discourse use double nginx error : Could not find module `handlebars` imported from `discourse-common/lib/raw-handlebars`
Can't upgrade user to admin - unhandled server error
Can't upgrade user to admin - unhandled server error
/?status=deleted filter crashes browsers
/?status=deleted filter crashes browsers
Save button on profile page disappears with Calendar plugin
Modal is set to display none;
Performing bulk actions as a moderator
My forum stays on the loading screen "Could not find module `virtual-dom` "
Where to find standard supported dark theme?
Easy Responsive Footer Plug-in bug issues
'qa-topic-tip' Ember is not defined error
New Group - 500 Error
Image preview gets cut off
Inline formatting used when "preformatted text" formatting applied to multi-line selection
Site stopped working "without reason"
Overlapping text and menus after upgrade to 3.2.0.beta4-dev
I can't display my policy
I can't display my policy
User profile links redirect to 404 page
Overlapping text and menus after upgrade to 3.2.0.beta4-dev
No access to backup page
No access to backup page
Black hole in Sub-Category
Text selection is cancelled when the AI popup disappears
Preview scrolls to the bottom after editing a post
Moving the server
Text selection is cancelled when the AI popup disappears
Page keeps loading after update
Entire site is a blank page after upgrade
Unable to reply due to javascript error [Quick Quote theme component]
The Missing Public Profiles Mystery [Animated Avatars]
No user preferences updating on my site
Cannot Create New Topics
Cannot Create New Topics
Forum broken for Admin - Assets missing?
Topic embed and import don’t validate for 0 character titles
Topic embed and import don’t validate for 0 character titles
Where is, "top" on category views?
Settings opens showing black
Collapse Button Not Working on Profile Page (Mobile)
Users can post to forum on PC, but not with mobile
Hide parts of a post
The "community" tab is no longer visible in the sidebar
Made some changes I cannot revert
Copy quote functionality
Discourse forum wont load any pages whatsoever
Set Slow Mode return a 403 error - I am administrator
UI crashes due js translation error
Template list takes 5-10 seconds to load
Board unaccessible after upgrade
Board unaccessible after upgrade
Cannot login as administrator after latest update
Cannot login as administrator after latest update
Cannot login as administrator after latest update
Bug with avatar of all staff are default icon while custom one is uploaded
All links to categories broken?
Images not appearing after domain change
Keyboard and mouse stopped working + content-security-policy error
Update = :skull_and_crossbones:
`white-space` CSS property of clipboard data not respected when pasting in rich text editor
Discourse broken after moving servers
Dragging highlighted texts causes Chrome freeze
Client-side vs. server-side?
Client-side vs. server-side?
While loading a new component on the site, the site is down
Can't get Ruby to update so ./launcher rebuild app keeps failing
Base_path not being substituted in some cases
Edit CSS/HTML of custom theme not appearing
Save button on profile page disappears with Calendar plugin
Finding Discourse RSS feeds
500 Error when posting, moment.tz runtime error
Some DMs are not visible
Air Theme Latest Update - Crash
Dashboard New Posts statistics broken
The order of characters when typing in the floating search widget is reversed
Floating search box cannot be closed when device goes from horizontal to vertical
I'm getting errors when I switch categories too quickly
Inline “preformatted text” formatting used when multi-line selection doesn't contain hard break
Coincidental Markdown in formatted content pasted to rich text editor rendered on publish
Category settings broken
Spurious notification when navigating away from review queue after adding note
Links produced by the Composer link modal break when they contain a ' (%27)
TypeError when submitting a flag with custom content (require_message flags)
OpenClaw plugin for Discourse integration
Case study of an amateur plugin author
500 error on category view mobile due to knowledge base plugin
A topic doesn't open with recent upgrade due to a plugin
Only loading HEAD after upgrading docker, due to Babble plugin
Category Icons
After rebuilding app, can't sign in with error 500
Using Cloudflare for HTTPS, empty preview pane in edit page
Writing an effective bug report
Avatar settings not visible with SSO
Emoticon button not working anymore (because of babble plugin)
Stable broken due to discourse-spoiler-alert
How to disable a plugin when admin plugin page is not loading
New topic and reply not working
Front page of discourse missing content
Messaging drop down menu not working
The composer needs to be more friendly to iPad Mini

De alguma forma, para mim esses links só funcionam quando eu os abro em uma nova aba ou janela. O primeiro leva à página de erro e o segundo à página inicial. Mas o banner do modo de segurança não aparece. O segundo pode causar problemas quando você envia um link para um usuário para que ele tente o modo de segurança. Se eles apenas clicarem no link, eles ainda usarão o site sem o modo de segurança.

Talvez essa informação deva ser adicionada ao how-to.

4 curtidas

Boa observação - ambos os links estão quebrados. O primeiro precisa de um ? e o segundo precisa de uma vírgula em vez de %2C

2 curtidas

Onde ele precisa de um “?”?
Você poderia compartilhar o link como exemplo?

1 curtida

Ah, desculpe, parece que errei na primeira: a navegação interna falha, mas para uma nova janela funciona.
Discourse Meta

E também errei na outra! Discourse Meta - The Official Support Forum for Discourse
não funciona como navegação na mesma página.

Meu erro: algo está quebrado, mas não são os URLs.

1 curtida

Acho que é porque ele está tentando abri-los no local. Em vez de discutir com ele, eu os troquei por try.discourse.org. :slight_smile:

2 curtidas

Eu acho que, de alguma forma, os administradores ainda deveriam ser informados de que compartilhar esses links pode facilmente ser um problema.

Por exemplo, eu reporto um problema no meta. Você poderia perguntar: “Você poderia tentar https://meta.discourse.org/safe-mode?” Então eu diria que o link não funciona.
Ou, pior ainda: você quer especificar que eu desabilite apenas os temas, então você me pede para tentar https://meta.discourse.org/?safe_mode=no_themes. Meu problema ainda existe. Como você tem certeza de que eu realmente usei o modo seguro? Como usuário, eu acho que funcionou porque algo aconteceu quando cliquei no link.

Depois que postei aqui, você sabe disso. Mas como outros administradores sabem que eles precisam prestar atenção que isso pode ser um problema?

3 curtidas

Estou me perguntando, devido à natureza desta página inicial segura exibida (que substitui todo o conteúdo), se uma exceção deveria ser feita para abrir este link em uma nova aba.

2 curtidas

Adicionei uma nota e também uma captura de tela de uma bem-sucedida. Como isso parece?

4 curtidas

3 posts foram divididos em um novo tópico: O modo seguro deve ser desativado por padrão para usuários não administradores?