>>102321542
>in short I can't, which is typical of windows.
Checkout Auto Hotkey (AHK), there is very little you can't do with that. I think you can even make a GUI if you wanted to choose between grabbing a url of the current page or the link under the mouse (at the time the script was triggered). Also here is what I got from ChatGPT when I asked about making a user script and python server
import http.server
import socketserver
import subprocess
import urllib.parse
PORT = 8000
class RequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
parsed_path = urllib.parse.urlparse(self.path)
query_params = urllib.parse.parse_qs(parsed_path.query)
if parsed_path.path == '/play' and 'url' in query_params:
url = query_params['url'][0]
# Use 'mpv' to play the URL
subprocess.run(['mpv', url])
self.send_response(200)
self.end_headers()
self.wfile.write(b'Playing video')
else:
super().do_GET()
Handler = RequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print(f"Serving at port {PORT}")
httpd.serve_forever()
Python server part