Closed Bug 1224892 Opened 6 years ago Closed 6 years ago
2 .override JS properties are dynamic (not cached), whereas the other 3 are not (cached & not reflecting changes until page (re)loading)
MozReview Request: Bug 1224892 - Caching `oscpu' and `buildID' like other attributes related to User Agent. r?smaug
40 bytes, text/x-review-board-request
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 Build ID: 20151029151421 Steps to reproduce: 1. Ran the JS from step 2. of description of bug 1224786 on an http(s): tab, & marked down the results. 2. Set overrides distinct from defaults for the following in about:config: general.appversion.override general.buildID.override general.oscpu.override general.platform.override general.useragent.override 3. Re-ran the JS from step 1. w/o reloading the page or loading a different one. Actual results: navigator.oscpu & navigator.buildID show the latest override values, whereas the other 3 show the values that were in effect during step 1. (before changes made in step 2.). Expected results: IMHO, they should all be consistent: all 5 should either be the latest override values, or all 5 should show the cached values that were current when the page was first loaded. P.S. I've seen this on tabs using http(s):, resource:, & ftp: URLs (as well as on about:home). It'd probably only make sense to deal w/ the rest of the protocols (such as a.-through-c. from bug 1224786), when that bug 1224786 is addressed. P.P.S. I've used (your humble servant's) Blend In extension to change values back and forth by toggling extensions.tildebirlik.privacy.blend-in.navigator.applicableIfRealPlatformIsNotWindows preference in about:config on Linux.  https://addons.mozilla.org/en-US/firefox/addon/blend-in/ P.P.P.S. If there's some consensus that caching of some & not others manifesting before page (re)loading is a fringe case that can just be WONTFIX'ed, i'm not gonna argue much with that, but it's still worth documenting this behavior (which this bug gets done in either case).
The cached values are because some of the properties are marked as [Constant, Cached] in the IDL. See bug 1069401 -- making them cached simplifies things considerably for workers. But the [Cached] stuff was added only to the properties exposed in workers, since it was only needed there. If someone wants to make the other ones [Cached] as well, go for it. It's a good way to get some familiarity with parts of the DOM code.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I am working on this.
Assignee: nobody → aidin
Bug 1224892 - Caching `oscpu' and `buildID' like other attributes related to User Agent. r?smaug
Attachment #8698504 - Flags: review?(bugs)
Because Boris is on vaccation, I asked Olli to kindly review this. Here's the try server build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=fda9566d49d1&selectedJob=14567173 I ran Mochitests to check if anything broke. Seems those failures are unrelated to my changes.
Comment on attachment 8698504 [details] MozReview Request: Bug 1224892 - Caching `oscpu' and `buildID' like other attributes related to User Agent. r?smaug https://reviewboard.mozilla.org/r/27799/#review25099 It is tiny bit odd to have Constant, Cached only in those two properies, but looks like it should be fine. Many of the properties just return some constant value, but this isn't performance critical, so Constant, Cached isn't really needed with those.
Attachment #8698504 - Flags: review?(bugs) → review+
Thanks for the review (:
sorry backed out for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=18705542&repo=mozilla-inbound
The failure was due to bug 1247346. Once that's fixed, this can reland.
You need to log in before you can comment on or make changes to this bug.