youtube-thumbnail-tester-chrome-extension icon indicating copy to clipboard operation
youtube-thumbnail-tester-chrome-extension copied to clipboard

Problème sur chronium via les input file

Open dasco69 opened this issue 4 years ago • 14 comments

Salut, sur chronium(ubuntu) lors du clique sur les input[type='file'] tu perd le focus du popup. j'ai essayer vite fais de générer une nouvel fenêtre mais pas top niveaux ui. Si tu inspecte le pop-up là tu ne perd pas le focus et tous fonctionne sans problème. Je sais pas si tu peux forcer le focus du popup dans tes événements "change".

dasco69 avatar Mar 26 '21 15:03 dasco69

Tried to fix this issue adding the correct permission to the manifest through https://github.com/bdebon/youtube-thumbnail-tester-chrome-extension/pull/30

But, as mentioned in this thread https://twitter.com/benjamincodeYT/status/1384487878814801924, the problem is well much more weird. This issue seems to occur only when the bounding box of the Chrome file browser is going out of the screen viewport image

I think that one possible fix to solve this issue is to do not have the real input into the template of the Chrome Extension, but to place a "proxy" input inside the current tab DOM tree.

benjaminrobinet avatar Apr 20 '21 13:04 benjaminrobinet

I see the idea of your fix. Still better the one that I had in mind... As you describe it, the bug happens only when the system file upload goes outside of the screen. If our popup is wide enough, the file system window will open in the middle of it without never going outside. But esthetically it's fucking weird... And don't know if it can fix it. I you set the width of the project to 1000px, do you still have the problem or no?

bdebon avatar Apr 20 '21 13:04 bdebon

image

Using a 1000px container size seems to fix the problem.

benjaminrobinet avatar Apr 20 '21 13:04 benjaminrobinet

Ok thank you for the try. I don’t know if I want to implement this fix but it’s good to know that we can explore this direction as a fallback. With this fix, we could set the size to 1000px and then wrap the content of the extension into a centered block that could have a width of the same size that it was before. We could set the background of the main tooltip in a certain color like black or whatever and then our extension would be centered in the correct size inside this huge and ugly poppin

Le 20 avr. 2021 à 15:46, Benjamin Robinet @.***> a écrit :

https://user-images.githubusercontent.com/2086507/115405874-ee770d00-a1ee-11eb-94c9-6b1fd5f7c4be.png Using a 1000px container size seems to fix the problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bdebon/youtube-thumbnail-tester-chrome-extension/issues/6#issuecomment-823287053, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPA34UILBN6ITW3WVNFQKTTJWARXANCNFSM4Z3RZPVA.

bdebon avatar Apr 20 '21 13:04 bdebon

I would definitely go for the "in document" / "proxy input" solution. Not sure if it can fix the problem, but deserve a try.

benjaminrobinet avatar Apr 20 '21 14:04 benjaminrobinet

Way more technical. Curious about it. No time on my side to try it, all the more if I’m not sure about the possible outcomes. Where will the system window will pop? I have high doubt about this implementation but also curious. Let me know if you try it. For now, I’m gonna implement the quick win of the wider extension but with better design implementation that the exemple above.

Le 20 avr. 2021 à 16:16, Benjamin Robinet @.***> a écrit :

I would definitely go for the "in document" / "proxy input" solution. Not sure if it can fix the problem, but deserve a try.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bdebon/youtube-thumbnail-tester-chrome-extension/issues/6#issuecomment-823310414, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPA34SKPQ4DSHRZND7V7KTTJWEC7ANCNFSM4Z3RZPVA.

bdebon avatar Apr 20 '21 14:04 bdebon

For more technical details:

  • Create a "proxy input" and add it into the tab document, should probably be hidden, and position: fixed to avoid conflict with Youtube layout.
  • Listen for changes on the proxy input, instead of the extension input
  • When clicking for upload thumbnail inside the extension, trigger a click event on the hidden input to open the file browser.

I don't have the time to go deeper into chrome extensions for now, but if someone is interested into trying to implement this workaround, let us know by mentioning this issue :)

Have a good day, and let's go for the temporary fix using a wider container for the extension @bdebon !

benjaminrobinet avatar Apr 20 '21 14:04 benjaminrobinet

@benjaminrobinet that a good idea of workaround. The thing i'm not to sure is if you can re open the popup programmatically if it unfocus it when you trigger the proxy click. I will give it a try out of curiosity :)

Jorand avatar Apr 21 '21 09:04 Jorand

@Jorand I just did a little pen / test case here: https://codepen.io/benjaminrobinet/pen/RwKqwMa It seems to have its chance no ? Well I am not sure to understand the possible issue using this workaround. Waiting for your feedback :)

benjaminrobinet avatar Apr 21 '21 09:04 benjaminrobinet

@benjaminrobinet I tried the proxy input. It kinda works but as you can see the popup unfocus/disappear after the file selection. I didn't find a solution to keep it open. https://www.loom.com/share/ed349220dd6c4614a8f71d307790ffe3

Jorand avatar Apr 21 '21 13:04 Jorand

Ohhhh @Jorand well seen... I guess programmatically focus back inside the chrome extension won't work ?...

benjaminrobinet avatar Apr 21 '21 14:04 benjaminrobinet

@benjaminrobinet Unfortunately not.. Open it back programmatically is not possible too i think. The weird thing is when inspect the popup and the chrome dev tool is open it stays open 😐. Last hope is to put the popup in the content script. I will try that and make a pull request so you can test it.

Jorand avatar Apr 21 '21 14:04 Jorand

Yes, it is how Chrome extensions are working... There is no way to keep an extension open when leaving the focus, nothing exists to keep it persisting... So yes, maybe the best fix to solve that would be to have the app directly injected into the YouTube tab (like Loom, or Pixel Perfect etc...)...

benjaminrobinet avatar Apr 21 '21 14:04 benjaminrobinet

Fix attempt -> https://github.com/bdebon/youtube-thumbnail-tester-chrome-extension/pull/31

Jorand avatar Apr 23 '21 16:04 Jorand