Bug 497223 - User agent set for specific sites no longer work
Summary: User agent set for specific sites no longer work
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.08.3
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Juraj
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-09 06:06 UTC by ewnme
Modified: 2025-06-16 21:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of custom User Agent Manager setting for specific web page not sent correctly (153.13 KB, image/png)
2024-12-09 06:06 UTC, ewnme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ewnme 2024-12-09 06:06:28 UTC
Created attachment 176454 [details]
Screenshot of custom User Agent Manager setting for specific web page not sent correctly

SUMMARY
In the User Agent Manager, when setting a custom user agent string for specific sites,  Falkon 24.08.3 still sends the global string instead.

STEPS TO REPRODUCE
1. Create a web page that requires a custom user agent string to access it, such as PHP's $_SERVER['HTTP_USER_AGENT'] variable.
2. Create a custom user agent for that web page in the User Agent Manager for that specific domain and/or page
3. Attempt to access the page in Falkon 24.08.3

OR

1.  Create a web page that echos the user agent string
2.  Create a custom user agent for that web page or the domain
3.  Open the page in Falkon 24.08.3 

OBSERVED RESULT
The user agent string is the Global one, rather than the custom one set for that specific page or domain

EXPECTED RESULT
The user agent string should be the one set in the section for specific sites.

SOFTWARE/OS VERSIONS
Linux:  Linux Mint Versions 21 & 22

ADDITIONAL INFORMATION
Comment 1 Juraj 2024-12-09 08:03:08 UTC
Hello, it works fine for me.
I believe this weorks with QUrl.host() only, so remove the "https://" and the trailing slash.

When I write "duckduckgo.com" and user "whatever" as userAgent, DuckDuckGo will see "whatever" as user agent.

PS: I agree with that this dialog needs some polishing.

Best regards,
Juraj
Comment 2 Bug Janitor Service 2024-12-10 23:23:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/falkon/-/merge_requests/100
Comment 3 Juraj 2025-06-16 21:02:51 UTC
Git commit 23204227a55a88fcc9f1c05916697968c9f6be7e by Juraj Oravec.
Committed on 16/06/2025 at 18:08.
Pushed by jurajo into branch 'master'.

UserAgentDialog: Use QUrl::host on user URL input

The system internally works with QUrl::host to compare the visited and
stored addresses to set UserAgent.

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>

M  +1    -1    CMakeLists.txt
M  +35   -0    src/lib/app/profilemanager.cpp
M  +3    -2    src/lib/preferences/useragentdialog.cpp

https://invent.kde.org/network/falkon/-/commit/23204227a55a88fcc9f1c05916697968c9f6be7e