aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-09-16 02:39:36 +0000
committerRob Austein <sra@hactrn.net>2019-09-16 02:39:36 +0000
commitb7434629d7955957eb393b55516ab8de59133e76 (patch)
tree5935ac795bad80ef9064dcbd1c5c37c86044dbe3
parentd0eb10aebbe3a31f4cc67b3dc368233d528e0377 (diff)
Icky hack
-rw-r--r--README.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/README.md b/README.md
index fce7c2f..6f7082c 100644
--- a/README.md
+++ b/README.md
@@ -47,3 +47,40 @@ https://ipmi.bar.example.org
There's probably some way to preset Waterfox's MIME handler for `jnlp`
files to run `/usr/bin/javaws` but after working out all of the above
I lack the patience to dig further today.
+
+Yeah, there's a way, and it's disgusting: pre-populate the Waterfox
+config tree, then overwrite or edit `handlers.json`. Something like
+this would work for the pre-population step:
+
+```
+waterfox --headless & waterfox=$!
+sleep 2
+kill -HUP $waterfox
+```
+
+Then either blindly `cp` or use a small Python script to edit the
+JSON. The snippet we want to add is:
+
+```
+ "application/x-java-jnlp-file": {
+ "action": 2,
+ "extensions": [
+ "jnlp"
+ ],
+ "handlers": [
+ {
+ "name": "javaws",
+ "path": "/usr/bin/javaws"
+ }
+ ]
+ }
+```
+
+as another entry in the `mimeTypes` section.
+
+```
+>>> import json
+>>> handlers = json.load(open("handlers.json"))
+>>> handlers["mimeTypes"]["application/x-java-jnlp-file"]
+{u'action': 2, u'extensions': [u'jnlp'], u'handlers': [{u'path': u'/usr/bin/javaws', u'name': u'javaws'}]}
+```