Skip to content

Conversation

@jakubartur
Copy link

Checklist:

@oobabooga
Copy link
Owner

What is the issue fixed by this change? And how does the change work?

@jakubartur
Copy link
Author

the copy button works without SSL, for example in a private LAN there is no need to set up SSL and then the copy button works

The HTTP fallback will be implemented directly in highlightjs-copy.min.js instead.
The Clipboard API requires a secure context (HTTPS). This adds a
fallback using document.execCommand('copy') for HTTP environments,
enabling the copy button to work on local networks without SSL.
@oobabooga oobabooga changed the base branch from main to dev January 14, 2026 22:30
@oobabooga
Copy link
Owner

Nice, thanks for the PR! I wasn't aware of this issue with code blocks on HTTP.

I refactored the fix to patch highlightjs-copy.min.js directly instead of intercepting clicks — based on a similar approach from xtekky/gpt4free#2302. Also formatted the file for readability.

@oobabooga oobabooga merged commit 21b979c into oobabooga:dev Jan 14, 2026
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.

3 participants