#3927 (Firefox stopped to run custom URL protocol handler)
by Luc Saffre · in Developers · assigned to hannes
Résumé
Firefox Version 77 has obviously optimized some security handling: the confirmation whether the user allows Firefox to run beid:// protocol must now be given per window. But Lino opens the beid url in a popup window which it closes immediately thereafter.
Concepts sous-jacents
Commentaires
- 5 ans, 8 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Also applied the local patch in config/beid/eidreader.js on weleup site, and sent them email with explanations.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : I made a local patch of the eidreader.js for welcht and sent them an email with explications. The solution seems satisfying.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Also focus() doesn't seem to work. One improvement is that when I give a name to the popup window, and when the user leaves this window open, then Firefox won't switch to it any more for subsequent calls. IOW the eidreader popup remains out of the way. But the first time is still disturbing because ...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : My next idea is to call [url developer.mozilla.org/en-US/docs/Web/API/Window/focus window.focus()] in order to switch back to the Lino window after opening the popup, and letting the popup remain open.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Also I didn't yet find a way to undo my "allow this for all popups". So I cannot really continue to test with my Firefox because now the problem has disappeared (for me).
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : We tried with saying popup.blur() instead of popup.close() but that seems to have the same effect. We also tried with a loop while (popup.event) {setTimeout(()=>console.log("waiting", popup.event),1000)}; but nope: seems that the [url developer.mozilla.org/en-US/docs/Web/API/Window event property] i...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : A new observation: Firefox fails to call eidreader because Lino.beid_read_card_processor() closes the popup window immediately after opening it. When I don't call popup.close(), it works but the popup window becomes activated, disturbing the end user.
Lino.beid_read_card_processor() = function() { ... - 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : I forgot to say that, in order to reproduce, you must also temporarily disable the "eidreader simulation": go avanti1 ; nano settings/demo.py ; adda "#" in front of the line that says "yield ('beid', 'simulate_eidreader_path', self.project_dir.child('simulate_eidreader'))".
def get_plugin_config... - 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Seems that custom URL protocol handlers do still work in newer Firefox versions. To verify this,: go avanti1, runserver, log in as robin. Click on [read eid card]. Open JS console. It says "Gonna open beid://127.0.0.1:8000/eid/5b578a24-fe00-44f2-8264-33cf59a18f3f". Type "beid://127.0.0.1:8000/eid/5x...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : I opened the follow-up ticket #3932 (which needs to be done before it makes sense to publish a new windows zip file).
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Hannes, one part of this will be for you because it requires a Windows machine. At your convenience you can start to try it already now: [url eidreader.lino-framework.org/build.html] (and you will have to create a new zip file when the new eidreader version is ready. This won't be before tomorrow).
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Yes, this idea seems to work. I am almost finished with eidreader version 2, which will work according to this new idea.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : New idea: the eidreader daemon is actually not an internet server. It would rather just poll every second whether there is a card in the card reader. And when a card is found, send this data immediately to the Lino server. Every client machine would get a unique id (given in its local ini file). Whe...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : But we don't want the eidreader client machines to become public web servers. So actually we won't need a http server. It is rather the eidreader client machin that should contact the Lino server, saying "Here I am, ready to answer your requests".
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : OTOH xml-rpx is maybe overkill and obsolete: [url en.wikipedia.org/wiki/XML-RPC#Criticism].
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : [url docs.python.org/3/library/xmlrpc.html xmlrpc] seems good for this purpose. It is built-in with Python.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Which protocol should the eidreader daemon use? The most basic would be socket ([url www.thoughtco.com/building-a-simple-web-server-2813571 see this example]), but my feeling says that socket is too basic. Should it be a http server? Or xmlrpc? Or soap?
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : I am afraid that a browser extension won't help either. What we need is a "Lino middleware", i.e. eidreader would become a daemon that is to run on the client machine. The eidreader daemon would accept incoming requests from a configurable address (the Lino server). The "read eId card" button in Lin...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : I found [url developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension this tutorial] about how to write a browser extension. But I am not yet sure whether a browser extension is what we need.
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : This is interesting to read: [url stackoverflow.com/questions/15807038/architectures-to-access-smart-card-from-a-generic-browser-or-how-to-bridge-the]
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : [url medium.com/swlh/custom-protocol-handling-how-to-8ac41ff651eb Here is an article on medium.com] which describes exactly how we use eidreader. But I am very afraid that this is now obsolete. The article is actiually wrong. It ignores the fact that their trick works only with Firefox. And you cann...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Thanks for the research, Hannes! While this is good as a quick workaround, we now need to find a new method, either for Firefox or for Chrome. So next questions: are custom url protocol handlers really deprecated? Or are there just new methods for confuring them? And if they are deprecated: what oth...
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Found [url support.mozilla.org/en-US/kb/install-older-version-firefox?redirectslug=install-older-version-of-firefox&;redirectlocale=en-US#w_i-still-want-to-downgrade-where-can-i-get-the-previous-version this link].
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : How can a customer get back to the old FF version?
- 5 ans, 9 mois ago by hannes about #3927 (Firefox stopped to run custom URL protocol handler) : $ /home/user/bin/beid.sh %u bash: /home/user/bin/beid.sh: Permission denied
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : This queston on StackExchange shows that our system is used also by other people: [url unix.stackexchange.com/questions/497146/create-a-custom-url-protocol-handler]
- 5 ans, 9 mois ago by Luc Saffre about #3927 (Firefox stopped to run custom URL protocol handler) : Jitsi Luc & Hannes to explain the problem. Send email with instructions. Hannes will now try to reproduce the problem and the research on this.