Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data from UC 11.7.8.958 and later is different when re-collecting #52

Open
foolip opened this issue Jan 12, 2018 · 4 comments
Open

Data from UC 11.7.8.958 and later is different when re-collecting #52

foolip opened this issue Jan 12, 2018 · 4 comments

Comments

@foolip
Copy link
Collaborator

foolip commented Jan 12, 2018

In API surface in Chrome, UC and QQ for Android there's something strange going on with CustomEvent, and when collecting the data again from UC 11.7.8.958 on the same phone (although reinstalled, not upgraded in a sequence, and Google Play Services having been upgraded) thing look different.

This appears in the output and doesn't show up if collected anew: function (e,t){if(!e)throw Error('TypeError: Failed to construct \"CustomEvent\": An event name must be provided.');var n;if(t=t||{bubbles:!1,cancelable:!1,detail:null},\"createEvent\"in document)try{n=document.createEvent(\"CustomEvent\"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail)}catch(l){n=document.createEvent(\"Event\"),n.initEvent(e,t.bubbles,t.cancelable),n.detail=t.detail}else n=new Event(e,t),n.detail=t&&t.detail||null;return n}

Or pretty-printed:

function(e, t) {
  if (!e) throw Error('TypeError: Failed to construct "CustomEvent": An event name must be provided.');
  var n;
  if (t = t || {
      bubbles: !1,
      cancelable: !1,
      detail: null
    }, "createEvent" in document) try {
    n = document.createEvent("CustomEvent"), n.initCustomEvent(e, t.bubbles, t.cancelable, t.detail)
  } catch (l) {
    n = document.createEvent("Event"), n.initEvent(e, t.bubbles, t.cancelable), n.detail = t.detail
  } else n = new Event(e, t), n.detail = t && t.detail || null;
  return n
}

Possibly there's some script that's being injected, but not always. AFAICT, this hasn't been part of the Chromium source tree.

@foolip
Copy link
Collaborator Author

foolip commented Jan 12, 2018

There was also a global K that went away when recollecting data. Weird.

@foolip
Copy link
Collaborator Author

foolip commented Jan 12, 2018

URLSearchParams has a problem similar to the CustomEvent problem, but a problem that doesn't go away when collecting the data again, at least not this time.

Where it says "function URL() { [native code] }" or URL, it says "function (e){if(e&&"object"==typeof e&&t(e)){var a=new r;return n(e).forEach(function(e){if(!t(e))throw TypeError();var r=n(e);if(2!==r.length)throw TypeError();a.append(r[0],r[1])}),a}return e&&"object"==typeof e?(a=new r,Object.keys(e).forEach(function(t){a.set(t,e[t])}),a):new r(e)}" for URLSearchParam. Pretty-printed:

function(e) {
  if (e && "object" == typeof e && t(e)) {
    var a = new r;
    return n(e).forEach(function(e) {
      if (!t(e)) throw TypeError();
      var r = n(e);
      if (2 !== r.length) throw TypeError();
      a.append(r[0], r[1])
    }), a
  }
  return e && "object" == typeof e ? (a = new r, Object.keys(e).forEach(function(t) {
    a.set(t, e[t])
  }), a) : new r(e)
}

So it looks there are parts of UC implemented in JS, probably in a way that doesn't get the prototypes quite right. Searching for "if(" one can spot more things like this, for example execCommand seems to be replaced. And something around Array.prototype.contains and Array.prototype.includes.

Given that the results don't seem to be the same reliably, it's hard to know what to make of this, except that it is web-observable and could possibly affect web developers.

@foolip
Copy link
Collaborator Author

foolip commented Jan 12, 2018

Funny, trying to isolate where the differences from 11.8.2.962 came from by running the collection yet again with the data saver enabled and disabled, suddenly I have UC version 11.8.3.963. It appears that UC upgrades itself without the help of any app store. 11.8.3.963 is newer than can currently be downloaded from uc.cn :)

@foolip
Copy link
Collaborator Author

foolip commented Jan 12, 2018

OK, so collecting a few more times, it looks like the API surface changes in subtle ways each time and I can't really spot what the stable thing is supposed to be. Must be some injected scripts, and this is an issue we'll have to raise with UC. Until the there will just be some noise in the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant