Code Monkey home page Code Monkey logo

Comments (7)

gantoine avatar gantoine commented on July 23, 2024 1

is it because localhost is taken as secure context?

yes something like that!

if that method is not available we show a popup with the link to copy it manually

makes sense to me, assigning this to you and backlogging it

from romm.

zurdi15 avatar zurdi15 commented on July 23, 2024

To be honest I only tested it in Firefox. Could you test with firefox and post the results?
About the toast it will appear when you copy the link, but didn't add any if the copy somehow fail! I'll add it for the final 3.1 release

I'll test myself in chrome and edge of course

from romm.

IvanMazzoli avatar IvanMazzoli commented on July 23, 2024

I had to switch PC, now I'm on Windows 11 and with Firefox (fresh installation) I still can't copy the download link. Here's the console error message:
image

EDIT: surfing StackOverflow I might have found what's causing the issue: https://stackoverflow.com/questions/51805395/navigator-clipboard-is-undefined
In fact I'm not using HTTPS and Romm is in a different machine than the one I'm using the browser on. I tried to change the flag in Chrome as suggested in Simon Dehaut's answer but it still doesn't work. Do you think it's possible to try the "hack" he suggested on SO?

from romm.

gantoine avatar gantoine commented on July 23, 2024

lmaooooo i can't believe i didn't see this in the PR 🤦🏼 navigator.clipboard is only available in secure contexts (https pages), and looking at your screenshots you're accessing it via an ip address.

@zurdi15 you used to be able to use document.execCommand as a workaround, but that was deprecated years ago and browsers are finally starting to remove it. i think the best thing is to just hide the button if the context isn't secure (not https web page)

from romm.

IvanMazzoli avatar IvanMazzoli commented on July 23, 2024

I don't really like the idea of not being able to just share the link if my connection isn't secure... what about a different approach like Google Photos?
image
If a secure context isn't available, just grey out the copy button but allow the user to copy it manually. In this case a better icon for the copy button would be a share one, like share-variant.

from romm.

zurdi15 avatar zurdi15 commented on July 23, 2024

lmaooooo i can't believe i didn't see this in the PR 🤦🏼 navigator.clipboard is only available in secure contexts (https pages), and looking at your screenshots you're accessing it via an ip address.

wow how is this possible? how could I use navigator.clipboard then? is it because localhost is taken as secure context?

In any case I like the google photos approach, if that method is not available we show a popup with the link to copy it manually

from romm.

gantoine avatar gantoine commented on July 23, 2024

This will be available in the next release (3.2.0).

from romm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.