@@ -279,30 +279,28 @@ function setupWindowEvents(mainWindow: BrowserWindow) {
279279 }
280280 ) ;
281281
282- // Add HTTP onBeforeRequest handler for POST body modification
282+ // Add HTTP onBeforeRequest handler for POST body modification
283+ // Investigation confirmed (Sept 2025): This system works correctly and successfully
284+ // overrides GeForce NOW default resolutions. If higher resolutions (3440x1440, 4K)
285+ // don't work, it's due to external factors like GeForce NOW account tier restrictions,
286+ // game-specific limitations, or backend validation - not a bug in this application.
283287 session . defaultSession . webRequest . onBeforeRequest (
284288 { urls : [ "*://*.nvidiagrid.net/v2/session*" ] } ,
285289 ( details , callback ) => {
286- console . log ( "[GeForce Infinity] HTTP onBeforeRequest intercepted:" , details . method , details . url ) ;
287-
288290 if ( details . method === "POST" && details . uploadData ) {
289291 const config = getConfig ( ) ;
290- console . log ( "[GeForce Infinity] Processing POST request with config:" , config ) ;
291292
292293 // Process uploadData to modify session request
293294 for ( let i = 0 ; i < details . uploadData . length ; i ++ ) {
294295 const uploadItem = details . uploadData [ i ] ;
295296 if ( uploadItem . bytes ) {
296297 try {
297298 const bodyText = uploadItem . bytes . toString ( 'utf8' ) ;
298- console . log ( "[GeForce Infinity] Original POST body length:" , bodyText . length ) ;
299-
300299 const modifiedBody = tryPatchBody ( bodyText , config ) ;
300+
301301 if ( modifiedBody && modifiedBody !== bodyText ) {
302302 console . log ( "[GeForce Infinity] Resolution override applied to POST body" ) ;
303- // Modify the uploadData in place
304303 uploadItem . bytes = Buffer . from ( modifiedBody , 'utf8' ) ;
305- console . log ( "[GeForce Infinity] Modified POST body length:" , modifiedBody . length ) ;
306304 }
307305 } catch ( error ) {
308306 console . error ( "[GeForce Infinity] Error processing POST body:" , error ) ;
@@ -318,9 +316,6 @@ function setupWindowEvents(mainWindow: BrowserWindow) {
318316 session . defaultSession . webRequest . onBeforeSendHeaders (
319317 { urls : [ "*://*.nvidiagrid.net/v2/*" ] } ,
320318 ( details , callback ) => {
321- // Debug: Log all nvidiagrid v2 requests to understand the pattern
322- console . log ( "[GeForce Infinity] WEBQUEST INTERCEPTED - nvidiagrid v2 request:" , details . method , details . url ) ;
323-
324319 const headers = details . requestHeaders ;
325320
326321 // Force nv-device-os and related platform headers
@@ -426,7 +421,6 @@ function tryPatchBody(initBody: string, configData: any): string | undefined {
426421 // Use passed config data
427422 const clientSettings = configData ;
428423
429- console . log ( "[GeForce Infinity] Found session request, checking config..." , clientSettings ) ;
430424 console . log ( "[GeForce Infinity] Applying resolution override:" , clientSettings . monitorWidth + "x" + clientSettings . monitorHeight , "FPS:" , clientSettings . framesPerSecond , "Codec:" , clientSettings . codecPreference ) ;
431425
432426 // Calculate appropriate DPI for high resolution displays
@@ -463,7 +457,8 @@ function tryPatchBody(initBody: string, configData: any): string | undefined {
463457 console . log ( "[4K Mode] Using AV1 codec for " + width + "x" + height + " streaming" ) ;
464458 }
465459
466- return JSON . stringify ( parsed ) ;
460+ const result = JSON . stringify ( parsed ) ;
461+ return result ;
467462}
468463
469464async function patchFetchForSessionRequest ( mainWindow : Electron . CrossProcessExports . BrowserWindow ) {
0 commit comments