Detecting OS type (Windows, Mac OS X and Linux)

23 views
Skip to first unread message

Ziyuan Yao

unread,
May 10, 2012, 8:28:34 AM5/10/12
to Chromium-extensions
How does an extension find out which type of OS it is running on
(Windows/MacOSX/Linux)?

Zachary “Gamer_Z.” Yaro

unread,
May 10, 2012, 8:35:37 AM5/10/12
to Ziyuan Yao, Chromium-extensions

You can probably just check the user agent string.

—Zachary “Gamer_Z.” Yaro

On May 10, 2012 8:28 AM, "Ziyuan Yao" <yaoz...@gmail.com> wrote:
How does an extension find out which type of OS it is running on
(Windows/MacOSX/Linux)?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

Ziyuan Yao

unread,
May 10, 2012, 9:29:19 AM5/10/12
to Chromium-extensions
And how to get the user agent string?

On May 10, 8:35 pm, Zachary “Gamer_Z.” Yaro <zmy...@gmail.com> wrote:
> You can probably just check the user agent string.
>
> —Zachary “Gamer_Z.” Yaro
> On May 10, 2012 8:28 AM, "Ziyuan Yao" <yaoziy...@gmail.com> wrote:
>
>
>
>
>
>
>
> > How does an extension find out which type of OS it is running on
> > (Windows/MacOSX/Linux)?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.

Ziyuan Yao

unread,
May 10, 2012, 9:30:56 AM5/10/12
to Chromium-extensions
I see, navigator.userAgent.

PhistucK

unread,
May 10, 2012, 9:30:48 AM5/10/12
to Ziyuan Yao, Chromium-extensions
navigator.userAgent

This is not a general browser/JavaScript forum. If you do not know the basics, learn them elsewhere first.

PhistucK



To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

Łukasz Łoboda

unread,
May 10, 2012, 10:50:02 AM5/10/12
to PhistucK, Ziyuan Yao, Chromium-extensions
PhistucK i get your point, but I really don't like such attitude - it don't serve well for our community. 
Ziyuan i recommend you to check all new HTML5 apis, also very educational behavior is to make console.dir(window), console.dir(document) (and others) to check what interesting lay behind those objects. I've found tons of nice stuff and learn more than reading 100 tutorials.

Regards


2012/5/10 PhistucK <phis...@gmail.com>

Ziyuan Yao

unread,
May 10, 2012, 11:29:24 AM5/10/12
to Chromium-extensions
Yes sir!

On May 10, 9:30 pm, PhistucK <phist...@gmail.com> wrote:
> nạvìgātòr.userAgent
>
> T͈ħis is̩ not à g̍ẹnèràl brọ̋w̵s̩èr/Jạ̈vàSc̩ript fọ̈rùm. If yoü dŏ not ꝁnōw̵ t͈ħè
> bạ̄sic̩s, lear̰̈n t͈ħem ẹlsėwħerė fir̰̈st.
>
> ☆*PhistucK*
>
>
>
>
>
>
>
> On Thu, Māy̵ 10, 2012 at 4:29 PM, Ziyuan Ya̋o <yaoziy...@gmail.c̩om> w̵rōtė:
> > Ànd hőw̵ tŏ get t͈ħè ụ̄s̩èr ạ̄g̍ènt strin̩ǥ?
>
> > On Māy̵ 10, 8:35 pm, Zạc̩ħàrÿ “Gạ̄mèr_Z.” Yaro <zmy...@gmail.c̩om> w̵rōtė:
> > > Yoü c̩an prọbàblÿ just c̨ħec̩k t͈ħè ụ̄s̩èr ạ̄g̍ènt strin̩ǥ.
>
> > > —Zạc̩ħàrÿ “Gạ̄mèr_Z.” Yaro
> > > On Māy̵ 10, 2012 8:28 AM, "Ziyuan Ya̋o" <yaoziy...@gmail.c̩om> w̵rōtė:
>
> > > > Hőw̵ dôes̩ an e̍xtẹnşiòn fīnd őut wħic̨ħ tȳpė òf̩ OS it is̩ rụnnin̩ǥ on
> > > > (Wịndōw̵s̩/MacOSX/Lịnùx)?
>
> > > > --
> > > > Yoü rècẹ̄ivėd t͈ħis mẹssàg̍ė be̍c̩ạ̏us̩ė yoü ärė sùbsc̩rị̄bėd tŏ t͈ħè Gọ̆ŏglė
> > Groüps
> > > > "C̩ħrọ̄mïùm-e̍xtẹnşiòns̩" groüp.
> > > > Tŏ pōst tŏ t͈ħis groüp, send ēmạ̄il tŏ c̩ħrọ̄mïùm-extensi...@c̩ħrọ̄mïùm.örg.
> > > > Tŏ ùnsùbsc̩rị̄bė fròm t͈ħis groüp, send ēmạ̄il tŏ
> > > > c̩ħrọ̄mïùm-e̍xtẹnşiòns̩+unsubscr...@c̩ħrọ̄mïùm.örg.
> > > > För mörė ọpţiòns̩, vịs̩ìt t͈ħis groüp at
>
> >http://groüps.gọ̆ŏglė.c̩om/à/c̩ħrọ̄mïùm.örg/groüp/c̩ħrọ̄mïùm-e̍xtẹnşiòns̩/?hl=en.
>
> > --
> > Yoü rècẹ̄ivėd t͈ħis mẹssàg̍ė be̍c̩ạ̏us̩ė yoü ärė sùbsc̩rị̄bėd tŏ t͈ħè Gọ̆ŏglė Groüps
> > "C̩ħrọ̄mïùm-e̍xtẹnşiòns̩" groüp.
> > Tŏ pōst tŏ t͈ħis groüp, send ēmạ̄il tŏ c̩ħrọ̄mïùm-extensi...@c̩ħrọ̄mïùm.örg.
> > Tŏ ùnsùbsc̩rị̄bė fròm t͈ħis groüp, send ēmạ̄il tŏ
> > c̩ħrọ̄mïùm-e̍xtẹnşiòns̩+unsubscr...@c̩ħrọ̄mïùm.örg.
> > För mörė ọpţiòns̩, vịs̩ìt t͈ħis groüp at
> >http://groüps.gọ̆ŏglė.c̩om/à/c̩ħrọ̄mïùm.örg/groüp/c̩ħrọ̄mïùm-e̍xtẹnşiòns̩/?hl=en.

Reply all
Reply to author
Forward
0 new messages