Tuesday, February 21, 2017

45.8.0b1 available with user agent switching (plus: Chrome on PowerPC?!)

45.8.0b1 is available (downloads, hashes). This was supposed to be in your hands last week, but I had a prolonged brownout (68VAC on the mains! thanks, So Cal Edison!) which finally pushed the G4 file server over the edge and ruined various other devices followed by two extended blackouts, so the G5 was just left completely off all week and I did work on my iBook G4 and i7 MBA until I was convinced I wasn't going to regret powering the Quad back on again. The other reason for the delay is because there's actually a lot of internal changes in this release: besides including the work so far on Operation Short Change (there is still a fair bit more to do, but this current snapshot improves benchmarks anywhere from four to eight percent depending on workload), this also has numerous minor bug fixes imported from later versions of Firefox and continues removing telemetry from UI-facing code to improve browser responsiveness. I also smoked out and fixed many variances from the JavaScript conformance test suite, mostly minor, but this now means we are fully compliant and some classes of glitchy bugs should just disappear.

But there are two other big changes in this release. The first is to font support. While updating the ATSUI font blacklist for Apple's newest crock of crap, the fallback font (Helvetica Neue) appeared strangely spaced, with words as much as a 1/6th of the page between them. This looks like it's due to the 10.4-compatible way we use for getting native font metrics; there appears to be some weird edge case in CGFontGetGlyphAdvances() that occasionally yields preposterous values, meaning we've pretty much shipped this problem since the very beginning of TenFourFox and no one either noticed or reported it. It's not clear to me why (or if) other glyphs are unaffected but in the meantime the workaround is to check if the space glyph's horizontal advance value is redonkulous and if it is, assuming the font metrics are not consistent with a non-proportional font, heuristically generate a more reasonable size. In the process I also tuned up font handling a little bit, so text run generation should be a tiny bit faster as well.

The second is this:

As promised, user agent switching is now built-in to TenFourFox; no extension is required (and you should disable any you have installed or they may conflict). I chose five alternatives which have been useful to me in the past for sites that balk at TenFourFox (including cloaking your Power Mac as Intel Firefox), or for lower-powered systems, including the default Classilla user agent. I thought about allowing an arbitrary string but frankly you could do that in about:config if you really wanted, and was somewhat more bookwork. However, I'm willing to entertain additional suggestions for user agent strings that work well on a variety of sites. For fun, open Google in one tab and the preferences pane in another, change the agent to a variety of settings, and watch what happens to Google as you reload it.

Note that the user agent switching feature is not intended to hide you're using TenFourFox; it's just for stupid sites that don't properly feature-sniff the browser (Chase Bank, I'm looking at yoooooouuuuu). The TenFourFox start page can still determine you're using TenFourFox for the purpose of checking if your browser is out of date by looking at navigator.isTenFourFox, which I added to 45.8 (it will only be defined in TenFourFox; the value is undefined in other browsers). And yes, there really are some sites that actually check for TenFourFox and serve specialized content, so this will preserve that functionality once they migrate to checking for the browser this way.

If you notice font rendering is awry in this version, please compare it with 45.7 before reporting it. Even if the bug is actually old I'd still like to fix it, but new regressions are more serious than something I've been shipping for awhile. Similarly, please advise on user agent strings you think are useful, and I will consider them (no promises). 45.8 is scheduled for release on March 7.

Finally, last but not least, who says you can't run Google Chrome on a Power Mac?

Okay, okay, this is the PowerPC equivalent of a stupid pet trick, but this is qemu 2.2.1 (the last version that did not require thread-local storage, which won't work with OS X 10.6 and earlier) running on the Quad as a 64-bit PC, booting Instant Web Kiosk into Chromium 53. It is incredibly, crust-of-the-earth-coolingly slow, and that nasty blue tint is an endian problem in the emulator I need to smoke out. But it actually can browse websites (eventually, with patience, after a fashion) and do web-browsery things, and I was even able to hack the emulator to run on 10.4, a target this version of qemu doesn't support.

So what's the point of running a ridiculously sluggish emulated web browser, particularly one I can't stand for philosophical reasons? Well, there's gotta be something I can work on "After TenFourFox"™ ...

Jokes aside, even though I see some optimization possibilities in the machine code qemu's code generator emits, those are likely to yield only marginal improvements. Emulation will obviously never be anywhere near as fast as native code. If I end up doing anything with this idea of emulation for future browser support, it would likely only be for high-end G5 systems, and it may never be practical even then. But, hey, Google, guess what: it only took seven years to get Chrome running on a Tiger Power Mac.

13 comments:

  1. This is great...you're keeping my 20 inch G4 iMac in service. After reading your assessment of the likelihood of a TenSixFox (not!) I've taken my 32-bit Early 2006 Intel Core Duo iMac for a walk on the Peppermint OS Linux side, where it runs the latest Chromium, Opera, and Firefox browsers. Peppermint OS is a fairly user-friendly Ubuntu variant that can be tweaked to appear pretty much as OS X, so it still feels like home...

    ReplyDelete
  2. Wow. The improvement is noticeable. This is great work.

    ReplyDelete
  3. Cameron, there are no plans to make this the only method to change the browser UA in the future are there?

    One of the reasons I had to abandon Opera so long ago was that one of the default UA's was just too old. But there was no way to change it. You had to use one of the defaults.

    I'd hate to be in the spot where there's only a handful of choices on a menu and no way to change it.

    I don't believe you'd do that but I just wanted to confirm it.

    Thanks, T4Fx is working great!

    ReplyDelete
    Replies
    1. It will be the only *supported* method, but changer addons will still work to change it, with a couple general caveats (I won't block those). Because this option and those sorts of changer addons are competing for the same setting in about:config, they may stomp on each other. In particular, if you enter the TenFourFox preference pane for some other reason, the user agent preference may be reset because the prefpane isn't expecting other things to be changing it.

      In theory it should be possible to have a "Hands off" option in that drop-down, but we don't have a locale string for that, and it would be confusing to those people who don't understand what's going on (relatively few users took our advice to use a user agent switcher for Base Crank, I mean, Chase Bank). I don't have a reliable way of detecting arbitrary extensions making changes under the table to conditionally display it.

      So, it will still work to change it by other means, but don't be surprised if it doesn't always "stick." Unlike Mozilla's current administration, however, I regard the capability of addons to do whatever the heck they like as a feature, not a bug.

      Delete
    2. Thanks Cameron.

      As long as there's a way to get the UA I want in there I'm good.

      Just don't want to be stuck like I was with Opera, wanting to use the browser but unable because there was no way to update or change the UA.

      Delete
  4. I have already twice had reason to use the built-in user agent switching. The first time was to make sure I have the current version -- 45.8.0b1 identifies itself as 45.7.0. (Is that deliberate?) Thanks for keeping my PowerPC useful after all these years!

    ReplyDelete
    Replies
    1. You're welcome! 45.7.0 is just because the version isn't revved yet. It will be upon release.

      Delete
  5. 45.8.0b1 works well for me. Very stable, no regressions or problems of any sort.

    ReplyDelete
  6. Well, I'm glad to say I've got my replacement G5 delivered today, which means I can start testing you betas again. Still haven't figured out what broke in my original G5. Regardless, I'm back!

    Also, how'd you get Qemu working on PPC? I've been looking for build instructions for a while now but never found any.

    ReplyDelete
    Replies
    1. It needs gcc 4.2 and some other prerequisites. I will be putting up a working unoptimized snapshot in Github in the near future (mostly as a known good savepoint while I work on TCG).

      Glad you got the G5 power back.

      Delete
    2. Actually on Leopard you can install qemu 2.2.0 via Macports 2.3.4

      https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.5-Leopard.dmg

      The later version of qemu with Macports 2.3.5 on Leopard doesn't work.

      I also just found out that using -vga cirrus will show correct colors on your emulated guest.

      Delete
  7. Runs REALLY Well, but the new UserAgent part seems to mess-up FoxBox's ability to hide that they are not normal browsers.

    Keep getting an update warning from Facebook for the first time in a FoxBox. Is there a way to mod the FoxBox's Prefs to get around this??

    ReplyDelete
    Replies
    1. This is because the "cloaked" option still uses a fixed user agent from 38. This is a minor change which I will do soon.

      Delete

Due to an increased frequency of spam, comments are now subject to moderation.