File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 124124 proxyURL = decodeURI ( tempCustomProxy ) ;
125125 } else {
126126 console . log ( "Using default proxy" ) ;
127- proxyURL = "proxy.php" ;
128127 }
129128
130129 // Check if the user is logged in, if not, prompt to login
Original file line number Diff line number Diff line change 11let ws ;
2- let proxyURL ;
2+ let proxyURL = null ;
33let activeTripObj ;
44let numberOfRequestTries = 5 ;
55let currentRequestTry = 0 ;
66
7+ const DEFAULT_PROXY = "https://corsproxy.afonsosousah.workers.dev/" ;
8+
79async function makePostRequest ( url , body , accessToken = null ) {
810 // Increment current request try
911 currentRequestTry += 1 ;
1012
11- const response = await fetch ( proxyURL , {
13+ const response = await fetch ( proxyURL ?? DEFAULT_PROXY , {
1214 method : "POST" ,
1315 headers : {
1416 "User-Agent" : "Gira/3.2.8 (Android 34)" ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ async function tokenRefresh() {
1313
1414 console . log ( "Token has not been refreshed..." ) ;
1515
16- const response = await fetch ( proxyURL , {
16+ const response = await fetch ( proxyURL ?? DEFAULT_PROXY , {
1717 method : "POST" ,
1818 headers : {
1919 "X-Proxy-URL" : "https://api-auth.emel.pt/token/refresh" ,
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ async function openUserSettings() {
176176 <div id="settingsContainer">
177177 <div id="proxy">
178178 <div>Proxy definido pelo utilizador</div>
179- <input id="proxyUrlInput" value="${ proxyURL } " placeholder="Insere aqui o URL para o proxy"/>
179+ <input id="proxyUrlInput" value="${ proxyURL ?? "Padrão" } " placeholder="Insere aqui o URL para o proxy"/>
180180 <div id="resetProxyButton"><i class="bi bi-arrow-counterclockwise"></i></div>
181181 <div id="setProxyButton"><i class="bi bi-check-lg"></i></div>
182182 </div>
@@ -201,7 +201,7 @@ async function openUserSettings() {
201201
202202 document . getElementById ( "resetProxyButton" ) . addEventListener ( "click" , ( ) => {
203203 // Delete customProxy cookie
204- proxyURL = "proxy.php" ;
204+ proxyURL = null ;
205205 document . cookie = 'customProxy=None;path="/";expires=Thu, 01 Jan 1970 00:00:01 GMT' ;
206206 // Update input
207207 document . getElementById ( "proxyUrlInput" ) . value = proxyURL ;
@@ -233,7 +233,7 @@ function openSetProxyPrompt() {
233233 } ,
234234 ( ) => {
235235 // Delete customProxy cookie
236- proxyURL = "proxy.php" ;
236+ proxyURL = null ;
237237 document . cookie = 'customProxy=None;path="/";expires=Thu, 01 Jan 1970 00:00:01 GMT' ;
238238 openLoginMenu ( ) ;
239239 } ,
You can’t perform that action at this time.
0 commit comments