-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix for Copy Button (with HTTP Fallback) #7358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
|
What is the issue fixed by this change? And how does the change work? |
|
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.
|
Nice, thanks for the PR! I wasn't aware of this issue with code blocks on HTTP. I refactored the fix to patch |
Checklist: