have been trying hundreds of possible fixes but couldn’t find anything so decided to ask.
I’m trying to create an extension that adds a context menu option to open a url using mpv.
I’ve done 90%, manifest.json, the .json inside NativeMessagingHosts, background.js and a launch_mpv.bat.
The problem is, if I run the .bat manually using echo "C:\mpv\mpv.exe --mute=yes --screen=0 --autofit=800x450 https://example.com" | .\launch_mpv.bat
, it works, but when I run the extension, I get the message Command sent to native app: C:\mpv\mpv.exe --mute=yes --screen=0 --autofit=800x450
https://example.com on the inspect extension window, but nothing happens, if I check the logs.txt, which logs what the .bat received, it says The following command was captured: l
(the l is always a ‘random’ character, it changes with the url, but sometimes it’s a character that’s not present in the url or the command as a whole)
I have no idea what else to do. I’ve tried changing the .bat for a .ps1 or .py, but it’s the same characters, meaning that the background.js is the problem, but I have no idea what to change, tried a bunch of stuff with the help of chatgpt but nothing worked.