pieroxy / java-user-agent-detection

Some code to deduce an OS/Platform/Browser out of a user-agent string
53 stars 12 forks source link

New Microsoft Edge Rendering Engine #1

Closed joealbertvp closed 7 years ago

joealbertvp commented 9 years ago

Hi, i would start saying this is a great project!. secondly as the user agent suggests from microsoft Edge the rendering engine is not the same as Trident, but the library stills say is "Trident", i think it would be best if it says "Edge".

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0

pieroxy commented 9 years ago

Edge may be a different rendering engine, but it is the clear continuation of Trident. That said, I need to make the difference, and this will be the opportunity to also differentiate Blink vs WebKit - although it will be much harder to be accurate since the UA didn't change in the process.

In short, I will get to it shortly.

pieroxy commented 9 years ago

I'll try to integrate this in the next release (a week from now)

mrDoctorWho commented 7 years ago

Sorry for doubling the message, but... any progerss on this?

hth commented 7 years ago

Awesome project but looks dead to me.

mrDoctorWho commented 7 years ago

It seems to be the best of what I could find. That is weird, actually, since java is widely used, but (almost) all projects that provide user agent parsing are dead.

pieroxy commented 7 years ago

Allright, I got sloppy. I'm going to resume updates. Give me a few days. That said, is there a reason Edge should be considered widely different from Trident? It looks like an incremental upgrade to me even if there was a steeper increment this time around.

mrDoctorWho commented 7 years ago

Yay, sounds great.

I think Edge should be considered different, because IE caused a lot of problems to the web devs and Edge doesn't seem to be that bad.

pieroxy commented 7 years ago

IMO, IE10/11 was already ahead of Chrome and Firefox in many areas when it got out. They stopped being an annoyance already. Edge is just a commercial name not tied at all to a fundamental change in technology. Hence my reluctance to move too fast in that direction. I'll think about it.

pieroxy commented 7 years ago

So, this work is underway and I was wondering how much you value non-breaking changes. I am planning on making the Browser.renderingEngine from a String to a RenderingEngine object (a new incoming class conveying more structured information). Would you rather have me add another field (something like Browser.renderingEngineDetails for example) hence not breaking your current implementations ?

This goes against performance and design, but I perfectly understand if it would be an issue on your side.

If you are OK with breaking changes I'll also try to move from fields to getters/setters (deprecating the usage of fields and making them private in a further down release) so that I will have more flexibility in doing this kind of updates without breaking anything next time.

mrDoctorWho commented 7 years ago

@pieroxy honestly, I'm all for getters. I don't like the current design with accessing fields that should be private.

Breaking changes are fine, as long as the documentation follows up with them.

hth commented 7 years ago

@pieroxy No problem. +1. Follow with documentation please.

pieroxy commented 7 years ago

Allright, work in progress. There is quite a bit of stuff to be done so I expect something to land by the end of next week.

pieroxy commented 7 years ago

I pushed the first commit do differentiate Trident from Edge. It is breaking API and there are more to come so I'd suggest to wait for the release, so you get all the breaking changes in one shot. Also I will introduce Blink vs WebKit (It is already in the enum)

mrDoctorWho commented 7 years ago

That is great!

Hope to check on it soon.

pieroxy commented 7 years ago

Ok, so I'm pretty much done with this. Still so much things to add... But:

  1. Edge and Trident are now different
  2. Blink and WebKit are now different
  3. No more internal fields exposed, everything is done through getters (except internally but still)

How does it look to you? I plan on releasing it shortly. Your input is appreciated.

mrDoctorWho commented 7 years ago

Edge and Trident are now different Blink and WebKit are now different

Well, yeah. That what I was talking about. Hope we are talking about rendering engines and browsers based on this engines will be considered a one browser (for example, older Chrome was based on Webkit).

No more internal fields exposed, everything is done through getters (except internally but still)

The more OOP style, the better.

pieroxy commented 7 years ago

Hope we are talking about rendering engines and browsers based on this engines will be considered a one browser

Chrome 26 and Chrome 29 are both Chrome browsers. However Chrome 26 had WebKit as a renderingEngine while Chrome 29 has Blink. Same goes for IE.

pieroxy commented 7 years ago

Done. Let me know if you would alike anything else in this area. Glad to have feedback.

hth commented 7 years ago

Appreciate. Thanks for new release !!!!

mothmonsterman commented 7 years ago

@pieroxy thank you very much for all the recent updates! what is the correct way to determine if Chrome or Edge is in use regardless of device? BrowserFamily.CHROME seems obvious but does not report correctly for iOS Chrome on an iPhone or iPad, Also, I still do not see a BrowserFamily.EDGE. Does it require checking multiple fields?

pieroxy commented 7 years ago

Hmmm. That's a good point. I should create a Chrome on iOS.

For Edge you should check the RenderingEngine family EDGE object. For Chrome you can check the RenderingEngine being of type BLINK. But Chrome on iOS is falsely reported as iOS's stock browser in a WebView, which it is actually.

mothmonsterman commented 7 years ago

@pieroxy Cool, thanks. Need another issue for creating a Chrome on iOS?

pieroxy commented 7 years ago

Good thinking.

https://github.com/pieroxy/java-user-agent-detection/issues/17