How to change navigator.platform property?

5,741 views
Skip to first unread message

Moses Mason

unread,
Aug 1, 2014, 12:42:49 AM8/1/14
to chromium...@chromium.org
Some sites only work on Windows and MacOS, and they detect user OS by using navigator.platform property. Firefox can change it easily, but can not find a way to spoof this under Chrome/Chromium?

Thanks in advance.

PhistucK

unread,
Aug 1, 2014, 3:17:17 AM8/1/14
to moses...@gmail.com, Chromium-discuss
I think you have two options -
1. Create a Chrome extension that uses a content script that injects a script at document_start with the following code -
Object.defineProperty(
 navigator,
 "platform",
 {
  get:
   function ()
   {
    return "some-platform-name";
   },
  set:
   function (a)
   {
   }
 });
2. Compile a customized version of Chromium.


PhistucK


On Fri, Aug 1, 2014 at 7:42 AM, Moses Mason <moses...@gmail.com> wrote:
Some sites only work on Windows and MacOS, and they detect user OS by using navigator.platform property. Firefox can change it easily, but can not find a way to spoof this under Chrome/Chromium?

Thanks in advance.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-discuss

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

PhistucK

unread,
Aug 1, 2014, 3:27:53 AM8/1/14
to moses...@gmail.com, Chromium-discuss
A third option (and maybe the best? unless it affects other applications, or even Chrome in a non compatible manner) -
The code uses the sysname and the machine fields of uname. If you try to override them, they might show up there.


PhistucK

Moses Mason

unread,
Aug 2, 2014, 1:35:53 AM8/2/14
to chromium...@chromium.org, moses...@gmail.com
An extension would be good, sadly I can not find such extension... Option 3 is also good. but this will still be a problem on Windows and Mac, a more generic way (maybe build-in support as in Firefox) to solve it would be appreciated.

Moses

unread,
Aug 2, 2014, 2:26:41 AM8/2/14
to Siva P Thumma, Chromium-discuss
@sivatumma Sorry your misunderstood, maybe my question is not clear.
In this issue, I am the user, not the webmaster. I need access some
website which restrict user with specific OS. That website use
browser's "navigator.platform" property (instead of user-agent string,
which is much easy to change) to check users' OS. So if there is a
Chrome extension we discussed exists in Chrome webstore, I just
install it and spoof that website so I can access it. There is no
deploy problem here.


On Sat, Aug 2, 2014 at 6:12 AM, Siva P Thumma <siva...@gmail.com> wrote:
> My doubt is even though a plugin is created, who would be deploying in all
> the client browsers who wish to access your application (website) ?
>
>
> -Siva P Thumma
--
"I may not agree with what you say but I will defend to the death your
right to say it"

PhistucK

unread,
Aug 2, 2014, 3:56:53 AM8/2/14
to moses...@gmail.com, Chromium-discuss
Chrome extensions are ridiculously easy to create, so you can try creating one by yourself.


PhistucK

Moses Mason

unread,
Aug 2, 2014, 6:52:05 AM8/2/14
to chromium...@chromium.org, moses...@gmail.com
Thanks, I will try :-)

Abc *

unread,
Sep 17, 2017, 9:39:35 AM9/17/17
to Chromium-discuss, moses...@gmail.com
you can't override uname without recompiling Linux 
Reply all
Reply to author
Forward
0 new messages