13 ms·
Inspecting Web Views in macOS
- emkoemko 5y agowhy does this matter? on GNOME i can pull up the javascript development console for the whole desktop this is nothing new.
- nguyenkien 5y agoGnome use javascript with native UI. Apple simply use webview.
- emkoemko 5y agoohh wow that seems inefficient to use a browser
- ThePowerOfFuet 5y agoInterestingly, the screenshot doesn't show <settings-app>, but <settigns-app> [sic].
- jimniels 5y agoOooh you’re right. I didn’t notice that. I wonder…
- efortis 5y agoAwesome! Do you know more Web Views in use?
- woodruffw 5y agoDon't quote me on this, but I believe that Apple Music (nee iTunes) has used web views for a long time; probably over a decade. The entire thing probably isn't a web view, but my recollection is that the store components were.
- efortis 5y agoLibrary -> Albums has some onHover feedback, which I haven't seen anywhere else. I guess the Help documents are Web Views as well, e.g. right-click on an image.
- ksec 5y agoYes, both iTunes and Apple Music. That is why they are slow, comparatively speaking. But they are finally rewriting Apple Music app to full native.
- lelandfe 5y agoUnsurprisingly the App Store is another example.
- jeroenhd 5y agoI remember giving up on my Hackintosh install after the App Store started rendering without CSS, breaking update functionality. Always thought that to be a weird failure mode for a system application.
- galad87 5y agoApp Store was rewritten in 10.14 and it no longer uses a Web View for the main content, some Apple ID setting might still be Web Views.
- sitharus 5y agoApple Music is now using a technology they developed to convert web views back to native - https://news.ycombinator.com/item?id=30648424 https://news.ycombinator.com/item?id=30648424 On macOS 12.2 Music consumes much less RAM, and no longer has a webview process.
- galad87 5y agoA lot of Apple apps used to use Web Views on macOS: Messages, Music, TV, App Store, for example. But they have been slowly phased out. Messages in Big Sur, App Store in Mojave, Music and TV in Monterey. Right now they are only a bunch of settings panels remaining.
- adamnemecek 5y agoGUI development is really fucking broken. I get it, it's hard to compete with a standardized platform with a probably billion man hours poured into it but I'm really hoping that Rust will make it possible to write native and web experiences from one codebase.
- throwaway81348 5y agowhy Rust in particular?
- hiptobecubic 5y agoWhat does rust have to do with this?
- zer0-c00l 5y agoit allows OP to farm karma effectively
- ashton314 5y agoAppears to be backfiring somewhat. I say that as a Rust enthusiast.
- adamnemecek 5y agoIts the first language that lends itself to be used both on the desktop fornative GUIs as well as in the browser.
- hiptobecubic 5y agoWhat? My understanding is that there isn't a native GUI toolkit written in rust for any platform at all. At least, not one that isn't a toy project.
- r00tanon 5y agoI missed the /s ?
- 5y ago
- lucasyvas 5y agoOK interesting - but why?
- jollybean 5y agoProbably because the devs want to do something and have no properly useful tools available to them, so they use something out of convenience. It feels a bit tacky to me that Apple would use something a bit janky, it points at a bit of a gap in tooling.
- est 5y agoLooks like it's Apple's Internet offerings, which is a growing number of services which makes perfect sense to write them inside a server updatable webview.
- 8note 5y agoReact is enjoyable to use?
- lucasyvas 5y agoAs a web developer that primarily codes in React for the last 5 years, I strongly disagree. I use it because of the ecosystem and I think everyone does. It's not that fast, and it's quite verbose. That's besides the point though, because I doubt Apple chose React because they "enjoyed" it here. I like web tech but I also think it's not worth it for this use case (even if it is shared with the web). What naturally happens is you start asking "well if we did it for that, why not for this?" Sooner or later it invades the system. I've worked on desktop apps where the same thing happened where webviews were not truly needed. I don't have a hate for it in general, but Apple was extremely strong in native UI so I would have liked to see them try to stick to that, even if it meant coding it twice.
- rhodysurf 5y agoIt’s definitely a bit disingenuous to call React verbose when you are comparing it to Cocoa et all.
- wetpaws 5y agoNot sure how do I feel about this, amused or horrified.
- lucasyvas 5y agoHow about bewildered?
- deleted 5y ago[deleted]
- johnfn 5y agoWow. I always thought the argument in favor of using web technologies on the desktop was that cross-platform became easier. And yet here is an example of the most unambiguously single-platform app I can possibly imagine, and under the hood it uses web - and React of all things! Crazy.
- ketzo 5y agoAs it turns out, React / CSS / the document-object-model are popular for more reasons than “it works on different computers.” Who knew!
- knome 5y agoI expect these additional reasons can largely be summed up as "I already know it from using it in the browser, so let's use that"
- dymk 5y agoYou'd probably be wrong! Let me introduce you to https://github.com/ocornut/imgui https://github.com/ocornut/imgui
- junon 5y agoWhich doesn't use React, CSS, or a DOM...? What's your point? ImGUI is imperative UI programming. DOMs are declarative.
- dymk 5y agoImGui makes UI programming declarative in structure the exact same way React makes UI programming declarative. React brings to the table is the general concept of immediate mode UI programming. So does ImGUI. Reaching for React doesn't mean it's the only thing the programmers knew, it means it's a general pattern that arises in UI programming.
- userbinator 5y agoThis might explain why, although I'm not a constant user of Mac, whenever I've had to use it, the UI has felt a little (and in the newer versions, significantly) more sluggish than Windows on the same hardware. It's not hard to see how someone accustomed to that level of responsiveness could find Electron not too different from a "native" app that's actually doing much the same thing.
- eropple 5y agoIt's like three webviews in the system preferences app. So probably not.
- userbinator 5y agoThat's exactly my point. If the true native apps are just as slow as the web ones, the latter don't seem any different, and thus, Electron apps too.
- chadstur 5y agoCertainly consider macOS using rounded corners, heavy drop shadowing, font smoothing, and animation.
- heavyset_go 5y agoTry the settings app in Windows 11. It's just as sluggish and unresponsive. At least in a VM, it has the tendency to freeze and be unresponsive to input.
- userbinator 5y agoThe one in Windows 10 is already much worse than the one it replaced, but I don't think it uses any webviews.
- simondotau 5y agoThe headline isn't technically wrong but it's a tiny bit misleading because the use of web views is limited to a small number of iCloud account screens. These aren't really "system" preferences so much as Apple cloud service settings which have been wedged into System Preferences. (And where it is used, it's doing the barest minimum. The preference window itself, the top bar, and the iCloud sidebar are all still native UI.)
- dang 5y agoWe've reverted the title now. Submitted title was "macOS System Preferences Uses React". "Please use the original title, unless it is misleading or linkbait; don't editorialize." https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- disposedtrolley 5y agoI wasn't surprised to see the Family Sharing pane in the first screenshot. It's easily the most janky part of System Preferences that I've had to struggle with: - Loading indicators for several seconds when switching between categories in the left sidebar, on a very decent internet connection. - Janky animations and transitions when opening modals, like clicking the "Details..." button on a family member. - Within the "Invite people to your family" modal, clicking "Not Now" causes the "Invite People" button (the default, highlighted action) to blink before the modal closes. Yes while these are absolutely nitpicks, I feel that Apple has lost some of the attention to detail that set them apart.
- jgalentine007 5y agoSounds like they need useMemo(), useCallback() and an abort pattern, lol.
- hybridtupel 5y agoMy thoughts exactly. I never liked these iCloud system settings and now I know why. They are not native but janky web views. Same for the Mac App Store which behaves very similar.
- soheil 5y agoNot really. There is a webview for certain account related stuff that gets loaded from a web page which happens to be a React app. Most other settings are native code and not loaded from a remote URL. Completely misleading post/title.
- neximo64 5y agoThat explains how looking at your iCloud preferences are near the most unreliable and slow part of settings. Even more so the Apple engineers never consider someone could live outside the US.
- lelandfe 5y agoAnd non-conformant UI, as well. It's like the HIG just doesn't exist anymore. Scroll up inside the Family Sharing family table. Does the interior of the table have an elastic scroll? NO! The entire Family Sharing pane instead scrolls up. Ditto for the Details sheet. That one also doesn't honor the system-wide feature of navigating prompts with Cmd-(first letter of buttons), doesn't support Esc to leave, and doesn't have a default button to boot. The +/- icons that appear in the Family Sharing are also completely unique to the OS. Ugh. I could go on.
- dmitriid 5y ago> It's like the HIG just doesn't exist anymore. It really doesn't, and Apple's own apps are the first to break all the HIGs
- firecall 5y ago100%. It's the worst. The glacially slow UI performance is terrible. It's also unreliable in weird ways that are hard to explain in a sentence or two.
- aaronbrethorst 5y agoI've always wondered why these panes in particular felt like total garbage in comparison to the rest of System Preferences. Now I know!
- yen223 5y agoConfirmation bias!
- deleted 5y ago
- InTheArena 5y agoQuick. Hide the evidence so the ATP purists can still insist on ideological purity and in the one true belief that the only way to write Mac Applications is to do everything in Swift or Objective-C. After all, If Apple does it....
- GekkePrutser 5y agoNothing wrong with it per se. But the developers choosing tech like Electron usually do it because it's low-effort cross-platform. With the emphasis on low-effort. It means they're not really willing to put in the work to make it run well. They just want to cobble something together and get it out there. There's really well-performing Electron apps, like VS Code. But the very same company also produces extreme turds, like MS Teams. This app is extremely unresponsive, takes about 30 seconds to sometimes even a minute to start up on a clean M1 Mac, and often crashes or just hangs. It's really horrible. And unfortunately the app I need the most for work. These are the apps that give these cross-platform web technologies a bad name. I understand why now that I have to struggle with this crap every day. With slack I just minded the UI not really fitting in but it performed just fine so I didn't hate the tech so much.
- int_19h 5y agoNote all the comments here about how that part of the UI is broken in so many ways.
- olliej 5y agoIt is using webview to display some content in an app that is native. That's been common practice in many Mac applications for a decade. WebKit exposes native NSView subclasses to make embedding them trivial enough that for some content they are /better/. Heavily formatted content? Write your own layout engine, or just use html? The problem with electron apps is that they are entirely a single webview, that poorly implements the vast majority of standard platform affordances (if you read the other comments, you see a lot of people complaining about this specific part of System Preferences). Add to that these applications using absolutely astounding amounts of ram, huge downloads because you're essentially downloading a full copy of chrome for each app, they all have terrible launch times (because there's each is loading its own copy of chrome), the bad and laggy accessibility features, etc and the reason people dislike them becomes fairly clear. I get that there's very little standard UI or inter app interaction on linux and windows, but historically that has not been the case on Mac - the increasing prevalence of low quality electron apps is making that less reliable. The only electron app that is actually a good app is VSCode, and even that is always frustrating to use due to a bunch of basic platform behavior that they at best get wrong, but more often just don't even attempt.
- boogies 5y agoSource-available variants of [GNU's Not] Unix have often been on the leading edge of user interfaces, from immitating the Xerox PARC desktop metaphor before Windows did (X11 initial release: June 1984, Windows: November 1985) to adding intrusive ads to the main system menu / search around the time Windows 8 was released. But it’s interesting to see macOS’s proprietary UI now apparently following GNOME’s example of powering “native” interfaces with JavaScript. Edit: apparently this is actually more similar to Windows, which also uses React for system settings. All this DE stuff is too complicated for a simple person like me (I just use dwm on desktop and mobile).
- marcellus23 5y agoApple has been doing that for ages, see e.g. the iTunes music store or Apple Music.
- nguyenkien 5y agoWindows settings use react native
- pjmlp 5y agoSadly, at least it uses WinUI/UWP underneath.
- creatonez 5y ago> [...] following GNOME’s example of powering “native” interfaces with JavaScript. Isn't this javascript but without web tech? That doesn't really stray too far from native anyways.
- badsectoracula 5y agoWindows 98 predated both of these, i.e. > to adding intrusive ads to the main system menu / search around the time Windows 8 was released ...active desktop's channels[0] were basically ads in your desktop > GNOME’s example of powering “native” interfaces with JavaScript ...HTML Applications, ActiveScripting (with the JScript backend) and an embeddable MSHTML/IE engine enabled both JavaScript and "web views" in applications (in Visual Basic 4 or later all you had to do was to use the web control to get instant HTML rendering capabilities). With "active desktop" you could even use an HTML or web page as your background, e.g. back then i had a hacker-ish background with scrolling assembly code at the side (the scrolling was done via javascript) ala Terminator - though i disabled it after some days since it was using pretty much all of my CPU :-P [0] https://i.imgur.com/9AqdbdM.gif https://i.imgur.com/9AqdbdM.gif [1] https://en.wikipedia.org/wiki/HTML_Application https://en.wikipedia.org/wiki/HTML_Application
- snowl 5y agoI really hate reading HN comments involving anything with JS. Probably some of the lowest quality comment sections on the site.
- deleted 5y ago[deleted]
- hombre_fatal 5y agoYep. I click in and get ready to cringe at the weird claims. Today there’s someone claiming that nobody enjoys using React.
- cosmotic 5y agoThis seems like a huge security risk. Are they auditing the thousands of third-party packages that make up a typical react app?
- ehnto 5y agoI have noticed web being used as a platform for UI in a bunch of programs, particularly within games.
- kizer 5y agoIt’s replaced ScaleForm (the Flash powered UI option) in many places it seems. I’d love to know what kinds of techniques are used for really flashy UIs. There are a few companies solely focused on this middleware (web-based UI in video games).
- SheinhardtWigCo 5y ago> Here’s an idea: guess at new features in macOS by using the work of Safari team members as a leading indicator. Shh, please... we don't want WebKit releases to look like xnu releases
- exikyut 5y agoHmmmm. I wonder which OS will support in-kernel JIT for JavaScript first. :v (/s ... I hope??)
- vlovich123 5y agoWhy would it need to be in-kernel? What advantage does that serve? For what it’s worth there’s JavaScriptCore (at least for mobile) which is the only way to do JIT on iOS. It’s constantly criticized as being slower than competing JavaScript JITs while Apple counters that it’s an important security barrier.
- skavi 5y agoIn kernel eliminates context switching overhead. Theoretically a perfect JIT doesn’t need hardware security. Also, JSC has been faster on Mac than V8 until a few days ago.
- vlovich123 5y agoWhat context switching overhead is eliminated? This makes no sense.
- Karen48 5y ago[flagged]
- z3t4 5y agoIts interesting that so many apps use web views... Is the native GUI libs really that bad?
- dmitriid 5y ago> Is the native GUI libs really that bad They are pretty good, especially for the simple things like preference panes. There are just many more web developers than native developers. And when you have a hammer...
- naoqj 5y agoNo wonder everything gets slower and slower every year. These people are shameless.
- tambourine_man 5y agoI think at some point Apple will just have to recognize that the web UI has won. I say that with a heavy heart, I enjoy them as a developer but despise them as a user. But it's really hard to compete. On the browser side, the vendor must only implement the standards as correctly and fast as possible, while the community tries all sorts of crazy paradigms and supports the ones that eventually stick. On the native side, the vendor must anticipate the trend, invest and support it. If it chooses the wrong one or the implementation is bad, it's years down the toilet. I fear that SwiftUI is taking that path.
- vlovich123 5y agoI don’t think it has anything to do with trends. It’s about $$. Web UIs are infinitely faster to develop, there’s typically better tooling (larger ecosystem), and there’s many developers which means you can get them cheap. The counter though is that Web UIs have struggled and continue to struggle with performance - specifically the RAM usage is insane for what the equivalent native UI. RAM is tightly coupled with standby time in sleep since RAM is the most expensive component at that phase. Turning off banks of RAM is important but you can’t do that if the banks are still in use.
- lenkite 5y agoFlutter would like to talk to you.
- tambourine_man 5y agoElaborate please
- lenkite 5y agoFlutter is the most popular cross-platform mobile SDK (already handily beat react native) and its not web-tech. It's now posing a very stiff challenge to native platform-specific UI frameworks. Many folks who wrote used web-views to developer apps are moving to flutter. https://stackoverflow.blog/2022/02/21/why-flutter-is-the-most-popular-cross-platform-mobile-sdk/ https://stackoverflow.blog/2022/02/21/why-flutter-is-the-mos... Once the desktop Flutter story kicks off, say good-bye to Electron.
- MrWiffles 5y agoFascinating. Thanks for sharing! In other news, does anyone know of an up to date catalog or list of all the “defaults” settings, possible values, and what they do? I looked for this several years ago and found nothing, and Apple’s documentation on MacOS was far better back then. As in, it existed. These days ask i can find is incomplete objective c docs that were auto-generated and offer absolutely nothing of value whatsoever (to me). So if anyone knows of some useful docs, please share!
- deleted 5y ago[deleted]
- reggaemahn 5y agoThis is something Apple has done for years. Especially with the native iTunes UI. They used to use Sproutcore pretty heavily for stuff like this, which later became Ember.js
- makecheck 5y agoDefinitely every one of these is sluggish at best on a very modern machine but they are also full of UI annoyances. God I am so tired of little spinners for things that would have displayed instantaneously on ten-year-old hardware with previous UI designs. I’m also really tired of things that pretend to be single apps but every other thing you click on will jerk you into an entirely DIFFERENT app. Oh, a sidebar: logically, clicking any item on the side should always update the right-hand side, right? Nope: some of the items you click on might update the right-hand side (after displaying a stupid spinner of course); others will hurl you into the App Store app and slide in some un-Mac-like UI to display 3 pieces of information (usually with truncation that can’t be fixed in a view that can’t be resized); still others might just open a web page (one that only works in Safari of course, because to hell with your browser preferences). Why is any of this crap necessary? It’s perfectly clear that Apple just doesn’t care at all anymore about making nice, smooth, usable experiences. More than that, they don’t seem to even know how their own desktop platform has traditionally behaved. But even if they did want to change how things behave, why are so many things behaving differently? It is a complete mess and they should be embarrassed. No leadership AT ALL on the UI front.