Skip to content

Fix: wrap livereload.js in DEBUG conditional - #2543

Merged
k9ert merged 1 commit into
cryptoadvance:masterfrom
al-munazzim:fix/remove-livereload-production
Mar 19, 2026
Merged

k9ert merged 1 commit into
cryptoadvance:masterfrom
al-munazzim:fix/remove-livereload-production

Conversation

@al-munazzim

Copy link
Copy Markdown
Contributor

The livereload.js script tag in base.jinja loads unconditionally — including in production. This causes:

  • Mixed content warnings (HTTP script loaded on HTTPS pages)
  • Failed network requests to localhost:35729 on every page load
  • Console errors for all users

Fix

Wrap the script tag in {% if config.DEBUG %} so it only loads during development.

Before

<script>document.write('<script src="http://...livereload.js..."></' + 'script>')</script>

After

{% if config.DEBUG %}
<script>document.write('<script src="http://...livereload.js..."></' + 'script>')</script>
{% endif %}

Fixes #2460

@netlify

netlify Bot commented Feb 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for specter-desktop-docs canceled.

Name Link
🔨 Latest commit 53e4a17
🔍 Latest deploy log https://app.netlify.com/projects/specter-desktop-docs/deploys/69bbf07192f2940008527602

The livereload.js script tag in base.jinja loads unconditionally in
production, causing:
- Mixed content warnings (HTTP script on HTTPS pages)
- Failed network requests to port 35729 on every page load
- Console errors for all users

Wrap it in {% if config.DEBUG %} so it only loads during development.

Fixes cryptoadvance#2460
@k9ert
k9ert force-pushed the fix/remove-livereload-production branch from 8bafae8 to 53e4a17 Compare March 19, 2026 12:47
@k9ert
k9ert merged commit a60e98e into cryptoadvance:master Mar 19, 2026
9 checks passed
Copilot AI added a commit that referenced this pull request Apr 17, 2026
- Accepted master's simpler config.DEBUG check instead of SPECTER_CONFIGURATION_CLASS_FULLNAME
- Removed test_livereload_conditional.py since the fix is already in master via PR #2543

Co-authored-by: k9ert <117085+k9ert@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hard coded http and port causing issues

2 participants