Opened on 02/25/2016 at 09:46:55 PM

Closed on 03/03/2016 at 12:59:06 PM

Last modified on 06/10/2016 at 11:27:49 PM

#3704 closed change (fixed)

Consider Edge a seperate platform in the generated "info" module

Reported by: sebastian Assignee: sebastian
Priority: P2 Milestone:
Module: Automation Keywords:
Cc: trev, kzar, oleksandr, sergz, scottlow Blocked By:
Blocking: Platform: Edge
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29337867

Description (last modified by sebastian)

Background

The info module provides metadata such as the platform, application and their respective versions. For Chrome, Opera and Edge that module is generated from chromeInfo.js.tmpl and the platform is currently hard-coded to "chromium". However, with Edge, this is no longer accurrate.

Also the version given by the Edge/ token in the user agent string, parsed there, refers to the platform (EdgeHTML), not to the application (Edge), unlike for other browsers.

What to change

Change the logic in chromeInfo.js.tmpl so that following info.* properties are initialized like below if the user agent string is indicating Edge:

platform "edgehtml"
platformVersion the version given by the Edge/ token in the UA
application "edge"
applicationVersion "0"

Attachments (0)

Change History (22)

comment:1 Changed on 02/25/2016 at 10:10:27 PM by sebastian

  • Component changed from Sitescripts to Build-and-Release-Tools
  • Description modified (diff)

comment:2 Changed on 03/02/2016 at 10:43:24 AM by sebastian

  • Cc trev kzar added
  • Ready unset

The assumptions in the issue description turned out to be wrong; Edge is already using a UA string similar to Chrome. So with the existing code, the current version of Edge will be recognized like that:

{
  application: "edge",
  applicationVersion: "25.10586.0.0",
  platform: "chromium",
  platformVersion: "42.0.2311.135"
}

But one question remains: Do we want to have info.platform set to "chromium" and info.platformVersion to the fake Chrome version given in Edge's user agent string, or should we rather consider Edge a separate platform? Technically, it is a different platform but as far as extension code is concerned not so much. The same holds true for Web Extensions for Firefox. Any thoughts?

comment:3 Changed on 03/02/2016 at 11:33:49 AM by oleksandr

  • Cc oleksandr added

comment:4 Changed on 03/02/2016 at 11:49:26 AM by trev

The engine is called EdgeHTML, that's the platform in this case IMHO (I'd agree to "edge" as well however). The user agent string is irrelevant in that case, the important part is the real technological basis of the browser. Aiming for full Chromium compatibility is great but Edge isn't Chrome. In theory, another browser embedding EdgeHTML should be possible.

comment:5 Changed on 03/02/2016 at 12:04:39 PM by sebastian

Sounds reasonable to me. But how would you (reliably) detect EdgeHTML other than by relying on the user agent string? The builds for Chrome, Opera and Edge will be compatible with all of these browsers. And we might have only one unified build in the future, anyway. Checking for the chrome namespace would allow to identify Chromium as of now. But since both, Edge and Firefox (Web Extensions), and who knows who else is following, expose the Chrome-like extension API with the browser namespace instead, this doesn't seem to be a good/reliable approach to detect the platform. Neither is there an extension API to detect the actual platform. So it seems the UA string is all we got.

Last edited on 03/02/2016 at 12:11:42 PM by sebastian

comment:6 Changed on 03/02/2016 at 12:18:50 PM by trev

I sincerely doubt that, that would be the first browser where the engine cannot be reliably identified by means of JavaScript. Worst-case scenario: window.external && typeof window.external.msTrackingProtectionEnabled == "function".

Last edited on 03/02/2016 at 12:22:25 PM by trev

comment:7 Changed on 03/02/2016 at 12:27:49 PM by oleksandr

FYI: https://dev.windows.com/en-us/microsoft-edge/platform/faq/what-is-the-microsoft-edge-user-agent-st/

For some non-interoperable/app-related scenarios, such as extensions, analytics, links to app stores, and pinned sites, you should use the “Edge” token to detect Microsoft Edge

So Microsoft actually recommends using UA.

Last edited on 03/02/2016 at 12:28:24 PM by oleksandr

comment:8 Changed on 03/02/2016 at 12:31:56 PM by sebastian

It of course depends on what you consider reliable. If checking for non-standard DOM APIs is any better than relying on the user agent string, sure that would be an option. However, as we have to rely on the UA anyway, for the application, applicationVersion and platformVersion, I guess it would be reasonable to rely on it for the platform itself as well, besides that seems to be what Microsoft recommends.

Last edited on 03/02/2016 at 12:32:36 PM by sebastian

comment:9 Changed on 03/02/2016 at 12:37:24 PM by trev

This will mostly depend on whether other application embedding EdgeHTML (apps?) will load extensions/use the same user agent string.

comment:10 Changed on 03/02/2016 at 01:00:43 PM by oleksandr

The EdgeHTML engine that is used in WebView in Universal Windows Platform applications uses the same EdgeHTML version that the Microsoft Edge browser uses. I have checked like described here? Those have the same user agent.

comment:11 Changed on 03/02/2016 at 01:11:54 PM by sebastian

Also we wouldn't be able to correctly detect platformVersion (and potentially application and applicationVersion) anyway if the user agent string is incompatible. Moreover, if we rely on non-standard DOM APIs, it will break if they get removed in the future. So I still think the user agent string is the best we got here.

comment:12 Changed on 03/02/2016 at 01:26:16 PM by sebastian

  • Description modified (diff)
  • Ready set

comment:13 Changed on 03/02/2016 at 01:32:11 PM by sebastian

  • Description modified (diff)

comment:14 Changed on 03/02/2016 at 02:21:13 PM by sergz

  • Cc sergz added

comment:15 Changed on 03/02/2016 at 02:26:48 PM by sebastian

  • Summary changed from Support Edge's user agent string in the generated "info" module to Consider Edge a seperate platform in the generated "info" module

comment:16 Changed on 03/03/2016 at 11:38:22 AM by sebastian

  • Description modified (diff)

comment:17 Changed on 03/03/2016 at 12:27:33 PM by sebastian

  • Owner set to sebastian

comment:18 Changed on 03/03/2016 at 12:45:42 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:19 Changed on 03/03/2016 at 12:59:06 PM by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:20 Changed on 05/07/2016 at 01:32:41 AM by sebastian

  • Cc scottlow added

comment:21 Changed on 05/23/2016 at 10:36:25 AM by sebastian

  • Keywords edge removed
  • Platform changed from Unknown / Cross platform to Edge

comment:22 Changed on 06/10/2016 at 11:27:49 PM by sebastian

  • Sensitive unset

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.