Add qutebrowser userscripts
This commit is contained in:
parent
93630811dd
commit
ed3b45302d
3 changed files with 16 additions and 1 deletions
14
qutebrowser/userscripts/clean-url
Executable file
14
qutebrowser/userscripts/clean-url
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
from urllib.parse import urlparse, urlunparse
|
||||
|
||||
mode = os.environ["QUTE_MODE"]
|
||||
url = os.environ["QUTE_URL"]
|
||||
fifo = os.environ["QUTE_FIFO"]
|
||||
|
||||
(scheme, netloc, path, params, query, fragment) = urlparse(url)
|
||||
clean = urlunparse((scheme, netloc, path, params, "", fragment))
|
||||
|
||||
with open(fifo, "w") as f:
|
||||
f.write(":open {}".format(clean))
|
||||
Loading…
Add table
Add a link
Reference in a new issue