You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
$ git clone [email protected]:HaNdTriX/service-worker-user-agent-electron-bug-.git
$ npm install
$ npm start
Then reload the renderer once to see the value of navigator.userAgent
Reacted by Lucas Barrena, Johan Wenz, Alexander Flatter, b0b, Hannes Christian Maack, Cyrus Frost, Isaac, bughit and Johannes Millan
I don't want to expose that I'm using Electron, so it would be enough for me not add "Electron/Version".
Would be great if there were something like disable the "powered by".
I tried search inside of the Electron files but I don't really see where the modification occurs.
Thank you for taking the time to report this issue and helping to make Electron better.
The version of Electron you reported this on has been superseded by newer releases.
If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.
I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.
We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.
Still not able to set user agent for service worker request. Using following code to set user agent app.userAgentFallback = "Custom user agent";
But getting following user agent in service worker requests. User-Agent: Chrome/69.0.3497.128 Electron/4.2.6
I found that if you set userAgentFallback after ready event of app, the useragent is not work for serviceworker request .
You can set userAgentFallback before ready event, like in the entry file.
Activity
LuKks commentedon Feb 15, 2019
Neither modifying the headers, at least my tries.
I don't want to expose that I'm using Electron, so it would be enough for me not add "Electron/Version".
Would be great if there were something like disable the "powered by".
I tried search inside of the Electron files but I don't really see where the modification occurs.
The second one is made by the service worker.

HaNdTriX commentedon Mar 11, 2019
@sofianguy I just tested
[email protected]and the bug is also present here.Can you add the corresponding tag (
5-0-x) as well?Thanks!
grgvineet commentedon Jul 15, 2019
Still not able to set user agent for service worker request. Using following code to set user agent
app.userAgentFallback = "Custom user agent";But getting following user agent in service worker requests.
User-Agent: Chrome/69.0.3497.128 Electron/4.2.6HaNdTriX commentedon Sep 20, 2019
Just for info you can now use the new
app.userAgentOverrideto work around this issue:#17650
electron-triage commentedon Feb 19, 2020
Thank you for taking the time to report this issue and helping to make Electron better.
The version of Electron you reported this on has been superseded by newer releases.
If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.
I'm setting the
blocked/need-infolabel for the above reasons. This issue will be closed 7 days from now if there is no response.Thanks in advance! Your help is appreciated.
electron-triage commentedon Feb 26, 2020
Thank you for your issue!
We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.
stewartlord commentedon Feb 26, 2020
Edit: the workaround is to set
app.userAgentFallback(not app.userAgentOverride)sputnikW commentedon Jan 8, 2024
I found that if you set
userAgentFallbackafter ready event ofapp, the useragent is not work for serviceworker request .You can set
userAgentFallbackbefore ready event, like in the entry file.