Skip to content
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

"only one file allowed" on Linux + Firefox/Chrome #36

Open
janjan opened this issue Jul 17, 2024 · 3 comments
Open

"only one file allowed" on Linux + Firefox/Chrome #36

janjan opened this issue Jul 17, 2024 · 3 comments

Comments

@janjan
Copy link

janjan commented Jul 17, 2024

Hi, thanks for your awesome tool!

After upgrading my PC you tool refused to accept pngs and svgs via drag'n'drop in Firefox and Chrome on Linux + KDE Plasma 6!

After a lot of head scratching and debugging I figured out that this problem is unrelated to your tool and that the real problems stems from the fact that my Linux switched from using X11 to Wayland. If you search for "Wayland firefox" you come across bugreports like this:

https://bugs.kde.org/show_bug.cgi?id=484018

KDE Plasma in Wayland does not support Drag and Drop operations from Dolphin to Chromium (and Firefox).

So there is basically nothing you can do on your side to fix it but I still decided to create this issue so that other people might find this report

(well, you could actually improve the error message by adding some additional code in onDragEvents() in /src/voronoi_app.js you can check if event.dataTransfer exist. If it is missing then there is a problem with the drag'n'drop functionality of your browser and you can alert with a better error message. But i am not sure if it is worth the trouble because hopefully this issue will be fixed in the next few weeks/months)

wassfila added a commit that referenced this issue Jul 20, 2024
@wassfila
Copy link
Member

@janjan thank you for your positive feedback about this tool and your help on working around this issue.
I did what you suggested in the referred to commit, I did not test it nor deploy it though.
Broader browser compatibility is indeed something valuable but also not that easy :)
I leave this open for some time, as open issue might be easier to find, then after some time I'll close it as the notification alert is now already implemented.

@janjan
Copy link
Author

janjan commented Jul 20, 2024

Hi, I just checked you code and I think it might be better to put the alert box with the new message like this:

if(event.type == "drop"){
   if(!event.dataTransfer){
      alert("Browser support issue, 'event.dataTransfer' does not exist")
   } else if(event.dataTransfer.files.length != 1){
      alert("only one file allowed");
      console.log(event.dataTransfer.files);
      return;
   } else {
      that.load_dropped_file(event.dataTransfer.files[0]);
   }
};

if you leave it right at the start of the onDragEvents function it will be triggered several times if the user is dragging files and then they will see several alert boxes

@janjan janjan closed this as completed Jul 20, 2024
@janjan janjan reopened this Jul 20, 2024
@wassfila
Copy link
Member

@janjan sure, I can updated to be as you suggested, but I give you some time if you'd like to PR this repo, that way you'd be a contributor ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants