diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 8e317481..176e5bfe 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -471,6 +471,7 @@ def run_argparse(argv, formatter): ap2.add_argument("--no-logues", action="store_true", help="disable rendering .prologue/.epilogue.html into directory listings") ap2.add_argument("--no-readme", action="store_true", help="disable rendering readme.md into directory listings") ap2.add_argument("--vague-403", action="store_true", help="send 404 instead of 403 (security through ambiguity, very enterprise)") + ap2.add_argument("--force-js", action="store_true", help="don't send HTML folder listings, force clients to use the embedded json instead") ap2 = ap.add_argument_group('yolo options') ap2.add_argument("--ign-ebind", action="store_true", help="continue running even if it's impossible to listen on some of the requested endpoints") diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 454231aa..b19de920 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2156,7 +2156,7 @@ class HttpCli(object): url_suf = self.urlq({}, []) is_ls = "ls" in self.uparam - is_js = self.cookies.get("js") == "y" + is_js = self.args.force_js or self.cookies.get("js") == "y" tpl = "browser" if "b" in self.uparam: