diff options
-rwxr-xr-x | examples/data/scripts/per-site-settings.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/data/scripts/per-site-settings.py b/examples/data/scripts/per-site-settings.py index eb9dae7..4afcc7a 100755 --- a/examples/data/scripts/per-site-settings.py +++ b/examples/data/scripts/per-site-settings.py @@ -100,6 +100,11 @@ def write_to_socket(commands, sockpath): if __name__ == '__main__': sockpath = os.environ['UZBL_SOCKET'] url = urlparse.urlparse(os.environ['UZBL_URI']) + + if not url.hostname: + # this is e.g. a file:// URL + exit() + filepath = sys.argv[1] mode = os.stat(filepath)[stat.ST_MODE] |