Skip to content

Commit

Permalink
Create fallback page for iOS browsers failing to open Tailscale login…
Browse files Browse the repository at this point in the history
… page (#198)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
  • Loading branch information
bitfliq and frenck committed Oct 15, 2023
1 parent ed4c86f commit 92122ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tailscale/rootfs/etc/nginx/templates/ingress.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ server {
proxy_pass http://backend;

sub_filter_once off;
sub_filter 'document.location.href = url' 'window.open(url, "_blank").focus()';
sub_filter 'document.location.href = url' 'var result = window.open(url, "_blank"); if (result!== null) {result.focus()} else {document.write(\'<div style="background-color:white"><font color=black>Unable to open Tailscale in new window. Please copy this URL, open it in a separate browser, and re-load the addon Web UI here when complete. <a href="\' + url + \'">\'+url+\'</a></font></div>\')}';

}
}

0 comments on commit 92122ba

Please sign in to comment.