File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > ProStore Redirect</ title >
7+ < script >
8+ // Function to read URL parameters
9+ function getQueryParam ( param ) {
10+ const urlParams = new URLSearchParams ( window . location . search ) ;
11+ return urlParams . get ( param ) ;
12+ }
13+
14+ // Redirect immediately
15+ window . addEventListener ( 'DOMContentLoaded' , ( ) => {
16+ const appName = getQueryParam ( 'app' ) ; // e.g. altstore
17+
18+ if ( appName ) {
19+ // Construct the custom URL scheme
20+ const redirectURL = `${ appName } ://source?url=${ encodeURIComponent ( "https://prostore-ios.github.io/apps.json" ) } ` ;
21+ window . location . href = redirectURL ;
22+ } else {
23+ // Fallback if parameters are missing
24+ document . body . innerHTML = "<h1>Missing app parameter!</h1>" ;
25+ }
26+ } ) ;
27+ </ script >
28+ </ head >
29+ < body >
30+ < p > Redirecting… If nothing happens, < a id ="manual-link "> click here</ a > .</ p >
31+ < script >
32+ const manualLink = document . getElementById ( 'manual-link' ) ;
33+ const urlParams = new URLSearchParams ( window . location . search ) ;
34+ const appName = urlParams . get ( 'app' ) ;
35+ if ( appName ) {
36+ manualLink . href = `${ appName } ://source?url=${ encodeURIComponent ( "https://prostore-ios.github.io/apps.json" ) } ` ;
37+ }
38+ </ script >
39+ </ body >
40+ </ html >
You can’t perform that action at this time.
0 commit comments