admin管理员组

文章数量:1415664

Synopsis: I am developing a HTML5 web app that will allow tablets(iPad or Droid) to login to a server and perform various functions. The client would like a way to check the devices mac address when logging in. From what I have read, most solutions use activex objects that will not work for webkit browsers.

Question: Does anyone know a solution that would hook into a HTML5 web app seamlessly(Idealy update a hidden form element with the value upon logging in)?

Thanks!

Synopsis: I am developing a HTML5 web app that will allow tablets(iPad or Droid) to login to a server and perform various functions. The client would like a way to check the devices mac address when logging in. From what I have read, most solutions use activex objects that will not work for webkit browsers.

Question: Does anyone know a solution that would hook into a HTML5 web app seamlessly(Idealy update a hidden form element with the value upon logging in)?

Thanks!

Share Improve this question asked Nov 30, 2011 at 0:06 FostahFostah 2,9564 gold badges56 silver badges79 bronze badges 1
  • I doubt it. A MAC address is a very low-level piece of information, a smartphone will have at least two of them and switch between them (as far as your application is concerned) randomly, and it's a fairly strong identifier so making it accessible is a privacy concern. – millimoose Commented Nov 30, 2011 at 0:15
Add a ment  | 

2 Answers 2

Reset to default 4

I don't think there's going to be a straightforward way to do this. The web server won't be exposed to a client's MAC address unless they're on the same physical segment...you'll only see the MAC from the most recent router hop in general.

If anything exists, it's going to be a browser plugin (show-stopper on iOS). And it would probably need more than the default permissions available (I don't suspect you can enumerate network interfaces in Java, for example, without asking for elevated permissions).

If you're looking for HTML/JS only then I don't think that this is possible. It won't be exposed.

The problem is that the packets you recieve back will only contain the MAC address of the node on the last hop.

This may be possible via a plugin, but then this limits you on iOS, and possibly also Android as you'd need to provide them a way of getting the plugin first (unless you used a plugin that was installed by default).

Edit: Not that I support an app for every little thing, but it shows that easy to press app buttons sometimes tend to do better than web apps (regardless of being able to make browser shortcuts to home screens). If it is suitable, you could consider loading this within a web view on the target device from within an app, from which you can then of course access MAC addresses and whatever else you may need.

MobiThinking: Mobile applications: native v Web apps – what are the pros and cons?

Forbes: Mobile Web App vs. Native App? It's Complicated

本文标签: javascriptGet a tablets(iPad or Droid) mac addressStack Overflow