Org-protocol with WSL2 on windows browser

The org-protocol works fine with wsl2 for Linux native browsers but doesn’t seem to work for browsers on windows.
Upon checking the debug console, one can see that a request to wsl2 is dispatched, and a command prompt window opens up briefly and shuts down again, but nothing happens on emacs.
I have set up the registry keys as directed in the documentation directed towards wsl2, but the roam-ref bookmarklet doesn’t produce the expected behavior (opening the corresponding buffer in emacs).

Any ideas on what I might be missing?

If it works in Firefox but not in a chromium browser, I suggest to update your Org. I guess you currently use 9.3.x (M-x org-version tells you which one). Try 9.4.x (9.4.5 is available through package-list-packages).

Hi, Thanks for your reply.

The issue is not primarily about it working on firefox and not on chrome but working for browsers native to the Linux distro and not on the windows ones (I am using WSL2).

Other than that, I am already using the latest version obtained from the source via straight.el (9.4.5).

I apologize if the question introduces some ambiguity in those regards, I’ll edit that part.

@rajp152k
… So … you are trying to do is to send some text data from 1 to 2 below?

  1. A browser on Windows (native to Windows)
  2. Emacs running on a Linux on WSL2

I didn’t know it would be even possible.
I might have seen one person trying to do this either on Org-roam Slack, or somewhere long ago but not sure if this was in the end successful.

If you have somehow configured the Windows registry so that the browser protocol points to Emacs on WSL2, I think you can place a break point (with edebug-defun) in Emacs (either somewhere in emacs-server or org-protocol to see if Emacs on WSL has received anything from the browser.

You may also like to directly contact karamme who has done the PR:

oh, okay;
Thanks for the contact, I did follow that section of the docs…

Apart from that, I’m pretty new to emacs (been 20 days) so will have to learn a little before I can get on with debugging some of Elisp on my own.

But I doubt that emacs is receiving the request due to some malformed path, I’m not sure exactly how to get that interop setup correctly. Will be investigating sometime over the weekend…

Thanks for your timely replies.