Rocket.Chat.Electron icon indicating copy to clipboard operation
Rocket.Chat.Electron copied to clipboard

Provide the capability to configure the user-agent

Open jpjoux opened this issue 3 months ago • 3 comments

Is your feature request related to a problem? Please describe. The Desktop application is not working when it is behind a proxy which allow only Edge Web browser

Describe the solution you'd like Heve the capability to set a user agent string compliant with my proxy restrictions in order to user the Desktop Application Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0

Describe alternatives you've considered use the web access but no notification are available. So I prefer to use the desktop app

Additional context Add any other context or screenshots about the feature request here.

jpjoux avatar Sep 26 '25 07:09 jpjoux

hi if this issue is open for contribution i would like to propose a solution to this issue the current code logic fallbacks to the default electron user agent which is Mozilla/5.0 (platform) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Electron/ rocketchat/, which may not be accepted by certain proxy configurations. Current Implementation is smthing like this:

window.loadURL(url, {
  userAgent: isGoogleSignIn
    ? app.userAgentFallback
        .replace(`Electron/${process.versions.electron} `, '')
        .replace(`${app.name}/${app.getVersion()} `, '')
    : app.userAgentFallback,
  httpReferrer: referrer,
  ...(postBody && {
    extraHeaders: `Content-Type: ${postBody.contentType}; boundary=${postBody.boundary}`,
    postData: postBody.data as unknown as
      | UploadRawData[]
      | UploadFile[],
  }),
});

the problem in this is the user agent string defaults to the Electron user agent when users are logging in this string is often blocked by proxies, preventing users from accessing Rocket.Chat. To mitigate this issue, I propose implementing a feature that allows users to specify their own custom user agent string this would enable users to set a user agent that is compatible with their proxy settings, potentially one that mimics a commonly accepted browser like Microsoft Edge what i came up with is User Interface for Custom User Agent: 1)Add a settings option in the Rocket.Chat Electron application where users can input their custom user agent string. 2)Provide a toggle to enable or disable the custom user agent feature. 3)Modify the URL Loading Logic: update the loadURL function to check if a custom user agent is provided by the user. If so, use that user agent; otherwise, fall back to the default behavior

Yashbhu avatar Oct 21 '25 10:10 Yashbhu

IS THIS ISSUE SOLVED I CAN IMPROVE IT By..... if @jpjoux approves assign within 1 WEEKS {WORKING NOW}

SDV96 avatar Nov 10 '25 18:11 SDV96

Unfortunatly I am not able to assign issues...

jpjoux avatar Nov 11 '25 08:11 jpjoux