Giter Club home page Giter Club logo

Comments (17)

maxwofford avatar maxwofford commented on August 10, 2024

Screen Shot 2022-01-26 at 10 13 50

The share link (1) button should create a share link and add it to the user's clipboard. On safari it notifies the user that the link was added to their clipboard (2), but when pasting the share link doesn't come out (whatever was previously in the clipboard does).

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

Forgot to mention, this works in FF & Chrome. This is probably the related code: https://github.com/hackclub/game-lab/blob/0dcd140b1814897bd1d425f62ca8c4273999fcc7/dispatch.js#L7-L14

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

Now running into this on FF
Screen Shot 2022-01-26 at 18 37 43

from sprig.

cjdenio avatar cjdenio commented on August 10, 2024

Yeah, most browsers only let you copy to the clipboard as a direct result of user interaction.

Chrome lets you explicitly request permission via the Permissions API, but Firefox and Safari don't support it yet

from sprig.

zachlatta avatar zachlatta commented on August 10, 2024

https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand

from sprig.

zachlatta avatar zachlatta commented on August 10, 2024

So I've done a little research here, and it turns out the issue is that Safari has some security policies in place that prevent any clipboard commenting to happen unless a DOM event is in scope (so to ensure that a DOM event triggered the copy to clipboard).

I am not sure what the appropriate way of passing the DOM event to the copy function would be with the architecture of Game Lab. @leomcelroy / @cedric-h: this might be a good thing for one of you to handle.

I've tried using various 3rd party clipboard libraries and none of the ones I've tried work, so I'm pretty sure it's down to the DOM event thing.

It looks like this might be a very recent thing. There are some other repos with this issue popping up, notably apache/superset#18154.

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

Copying doesn't work in any browser for me. Reopening

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

The diff for https://github.com/hackclub/gamelab/pull/67/files doesn't make sense to me– seems like something was mis-commited or something. If I'm reading it right it seems like it removes copy logic.

from sprig.

faisalsayed10 avatar faisalsayed10 commented on August 10, 2024

@maxwofford @leomcelroy this is my main commit - a7618a3 (#67)
i think something has went wrong, and we've mis-commited something

from sprig.

faisalsayed10 avatar faisalsayed10 commented on August 10, 2024

also @leomcelroy this commit of yours kinda reverted my commit b50ee51 (#67)

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

Something that might help for fixing this issue: saves are deterministic. Even before we make a post request, we know the share link will be gamelab.hackclub.com/?id=MD5 where MD5 is the hash of the game state

CC'ing @cedric-h who can correct me if I said something wrong.

from sprig.

isabellalacerda avatar isabellalacerda commented on August 10, 2024

Copying also doesn't work in any browser for me. How can i fix this?

image
image

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

Can you share the URL that screenshot was taken at? It doesn't look like a part of the gamelab interface

from sprig.

Peiprjs avatar Peiprjs commented on August 10, 2024

You can copy the URL from the console. Otherwise, it only copies some Javascript

from sprig.

alhardwarehyde avatar alhardwarehyde commented on August 10, 2024

@grymmy can you reproduce this?

from sprig.

alhardwarehyde avatar alhardwarehyde commented on August 10, 2024

Ignore my ask. This is an ongoing issue

from sprig.

grymmy avatar grymmy commented on August 10, 2024

An update on this issue - while the editor still does not correctly copy to the clipboard on safari, it shows a high-quality error and feedback to the user when it files to copy to the clipboard. As a result, I believe this is quite low priority - but I've confirmed yes, still a present bug

from sprig.

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.