jothepro / doxygen-awesome-css

Custom CSS theme for doxygen html-documentation with lots of customization parameters.
https://jothepro.github.io/doxygen-awesome-css/
MIT License
1.06k stars 118 forks source link

Fragment copy button not available when serving the HTML on remote server #125

Closed zeroxia closed 1 year ago

zeroxia commented 1 year ago

Hi,

I enabled the fragment copy extension in the Doxygen.

When viewing it as http://127.0.0.1:8080/, the code copy works OK.

When I put the HTML to a remote HTTP server, and view it like http://30.88.88.88, then the copy button is not available.

How to fix this?

Thanks.

zeroxia commented 1 year ago

I found on stackoverflow there is a question might be related:

https://stackoverflow.com/questions/72237719/not-being-able-to-copy-url-to-clipboard-without-adding-the-protocol-https

this is due to not using HTTPS. According to MDN Clipboard docs: "This feature is available only in secure contexts". The best option would be to just use HTTPS.

Is there any workaround? I'm only sharing the documentation within company LAN, setting up HTTPS seems overkill.

jothepro commented 1 year ago

As you already stated correctly, this is a restriction enforced by the browser. As a user of the API one has no influence on this. So I don't think there is a workaround other than serving the documentation over https.

jothepro commented 1 year ago

Closing this issue because this is not a bug, but rather a restriction enforced by browsers.