diff options
| author | St33v <github@f3rr3t.com> | 2021-05-13 12:24:51 +1000 |
|---|---|---|
| committer | St33v <github@f3rr3t.com> | 2021-05-13 12:24:51 +1000 |
| commit | c2fd3e86c7d6b1e2e68713a5a92677a32d8542a3 (patch) | |
| tree | 7375f7d9c400dc1029bd02263557d106b87cc03b /md.sh | |
| parent | 4356322ee72418cafaeb9d5ad65220201ac0bdd5 (diff) | |
Firefox banned top level URIs. So now do dxg-open on a temp file
Diffstat (limited to 'md.sh')
| -rwxr-xr-x | md.sh | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -3,6 +3,9 @@ # SJP 17 Feb 2021 # # stolen from https://unix.stackexchange.com/questions/24931/how-to-make-firefox-read-stdin/24942 +# +# 2021-05-13: update. Firefox no longer allows 'top level URLs' because security +# So I hacked this version from https://gist.github.com/defunkt/318247 # Check that we have a file to read if [ $# -ne 1 ]; then @@ -26,5 +29,12 @@ if [ ${mdFile: -3} != ".md" ]; then echo "Works best with a markdown input file, but we'll try to parse it anyway" fi -marked ${mdFile} | firefox "data:text/html;base64,$(base64 -w 0 <&0)" +hypertext=`mktemp /tmp/mdXXXXXX.html` + +marked ${mdFile} > ${hypertext} +# This actually opens chromium on my system but that's ok +xdg-open ${hypertext} + +# defunct 2021-05-13 +# marked ${mdFile} | firefox "data:text/html;base64,$(base64 -w 0 <&0)" |
