Useragent not workingon WIndows 10

I am using useragent for my php webpage.

I recognize the app and have the site format things differently

The code works fine on OS X, but Windows 10 it seems to ignore the user agent setting. Is this a known bug?

[quote=239946:@Tony Chamberlain]I am using useragent for my php webpage.

I recognize the app and have the site format things differently

The code works fine on OS X, but Windows 10 it seems to ignore the user agent setting. Is this a known bug?[/quote]

Are you referring to HTMLViewer ?

A quick test wIth the sample code #1 at http://php.net/manual/en/function.get-browser.php shows user-agent has been correctly set in 2015R4 on Windows 10 with this in the HTMLViewer Open event :

me.UserAgent = "This is a test"

You may want to verify your php is correctly treating the data.

It would be odd for it only to read the data correctly on the Mac client wouldn’t it. Exact same code being used on the windows side and I am setting the agent the same way you example, my agent is a simple one word string.

But one windows the php says the useragent is

Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19

but using a Mac the user agent reports my set agent…

Seems if I set the htmlviewer to be native it works, but if I use Webkit it doesn’t. But on Mac it works with both. SO Windows is having issues setting useragent on Webkit setting

http://documentation.xojo.com/index.php/HTMLViewer.Renderer
“This property is only available on the Windows platform.”

It’s not actually changing anything on Mac :stuck_out_tongue:

Tim I’m sorry but tat doesn’t explain why it doesn’t work on Windows, but does on Mac. And while you have a point about the rendered not being a choice on Mac, it still doesn’t explain why useragent is not working with Webkit on Windows

Originally, UserAgent was supposed to work only on Mac, according to the LR. Last year or so, after a discussion in the forum, Norman tried changing the user agent on Windows and it appeared to work, so the LR was modified to reflect that.

Now I just tested, and it does appear that WebKit just pretends to be Chrome 18 and does not change UserAgent.

This has been reported already : <https://xojo.com/issue/34561>

The LR should be modified accordingly, I think .
<https://xojo.com/issue/42089>

As far as your PHP recognition issue, if you need WebKit, the simplest way would be to use a URLParameter instead. It should not be too difficult to implement.

Michel thanks, I ran across the same conflicting information in my search for answers as well. Some said it worked, others said it did not.

The fact that the WebKit engine is Chromium under the hood, the fact that it thinks it’s Chrome is not surprising.