File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < title > Redirecting...</ title >
6+ < script type ="text/javascript ">
7+ // Get the current path from the URL.
8+ var path = window . location . pathname ;
9+
10+ // Get any search query parameters.
11+ var search = window . location . search ;
12+
13+ // Preserve the path and search query, but redirect using a hash.
14+ // This tricks the GitHub Pages server into loading the index.html
15+ // and lets the Flutter router handle the deep link.
16+ window . location . href = '/?' +
17+ 'redirect=' + encodeURIComponent ( path . substr ( 1 ) + search ) ;
18+ </ script >
19+ </ head >
20+ < body >
21+ </ body >
22+ </ html >
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html >
33< head >
4+ < script >
5+ ( function ( ) {
6+ // Look for the redirect parameter in the URL.
7+ var params = new URLSearchParams ( window . location . search ) ;
8+ var redirect = params . get ( 'redirect' ) ;
9+
10+ if ( redirect ) {
11+ // If a redirect path is found, replace the current history state
12+ // with the correct path, so the Flutter router can handle it.
13+ // We use replaceState to avoid breaking the browser's back button.
14+ window . history . replaceState ( null , null , redirect ) ;
15+ }
16+ } ) ( ) ;
17+ </ script >
18+
419 <!--
520 If you are serving your web app in a path other than the root, change the
621 href value below to reflect the base path you are serving from.
You can’t perform that action at this time.
0 commit comments