Browsers are runtimes and webpages are apps. They just happen to be apps that are dynamically fetched over the network and are packaged as HTML/CSS/JS instead of as PE/ELF/Mach-O binaries.
Runtimes can have bugs or inefficiencies that cause them to use more memory than strictly necessary, but by and large most memory problems are the product of the apps (or webpages) themselves.
> Browsers are runtimes and webpages are apps.
Surprised to see that.
I've been championing this mind set for nearly 20 years now. The message was more clear in the Flash era, but once you realize that your webpage is an (/a desktop) application that only happen to live in a browser - it makes a lot of reasoning and designing a lot easier.
> I've been championing this mind set for nearly 20 years now.
I don't want to tell you you've wasted your time but it's fairly obvious that webpages are sometimes documents, sometimes apps and sometimes a hybrid between the two. For example, YouTube is clearly an app, but a webpage written predominantly in HTML and CSS is much more of a document than an app.
You sir, you would be fairly dumbfounded to find that most people think that webpages are for showing trivial things founded on the backend side of them applications. Like when you want to change a filter on your amazon page and it suddenly give you a different page altogether, you know?
i'm not trying to be glib, i get what you mean, i just wonder if you have an actual criteria. I've been struggling with this from time to time over the years.
I would say a contained set of words, sometimes accompanied by static visual data (e.g. images), which aimed to convey ideas or information.
For example, a post on a recipe blog website can be seen as a document, even if there are sometimes some interactive elements (like being able to change ingredient amounts based on desired portion sizes), and even if there's usually a CMS behind the scenes helping the website author update their recipes, as the written recipe is at the core of what is being transmitted.
On websites the wide array of interactive elements do blur the lines between documents and apps, but the web was designed as a document sharing medium first and had app functionality bolted onto it afterwards. It's perfectly possible to have a website with zero JavaScript.
I don't know if that fully answers your question, but hopefully it's of some use.
it informs it. not sure it's a settled subject in my head per se though.
normally, when i think of a document, i think of something that is to be printed / printable properly. this puts javascript out of the picture for the most part, though not necessarily entirely. some pages sadly don't even load their content without javascript these days, like SPAs, or require custom streaming.
i needed to print directions from google maps one time for example, and even the inbuilt solution is basically just a fancy print screen of a page that was mostly rendered with javascript (or similar, i don't know their tech stack, not necessarily relevant). but then this brings about the idea that the page can be interactive, while exposing an end result that is printable.
or consider css. modern css has animations. one can even implement a navbar without any js, just pure css (and i very much appreciate when people do!). i'd permit media queries, but i'm not sure about fancy animated effects.
another thing i might want to bring up is grafana. it's just interactive charts. if i disable the autorefresh, it's not live either. requires javascript, but i believe if someone wanted to chart something some other way that is not grafana, it's possible to do some visualizations with just css alone as well in a way that is manipulable. end result is again static. i could conceivably print it.
i'm not even sure pure html, with no embedded js and css, escapes the non-document fate guaranteed. video tags include videos after all.
for me the bigger question is usually how much arbitrary execution a website requires instead. if it's all fixed function stuff, like html or css, i'd grade that higher than i'd websites requiring arbitrary code execution. but then technically modern fonts are also virtual machine bytecode that is executed during font rendering, so even just putting text on the screen can require arbitrary code execution. and even if we don't go that far, you do need to hold onto some state, since html is not a regular language for example (cue can't parse html with regex meme). and this isn't even getting into all the weird and whacky multimedia formats.
Anything I can print and still get most of the utility is a document. Even expand it a little to Harry Potter style print+video.
IMHO the distinction is on interactivity, if I'm expected to click around to change state (not just get to other page) then its an app, if not, it's a document.
A document is originally a scroll of papyrus. All other analogies flow from there. A video page on YouTube is kind of like a papyrus with a moving picture (that you can't actually do on papyrus but it flows through the analogy chain well enough). A game of Minecraft is nothing like a document, any more than the sky is a document. A static Minecraft world might be viewed as a 3D document.
Seems like one required criterion, maybe even the most important criterion, is that a document is static. It can be displayed in a way that changes with time (such as playing video) but it's a dynamic view over static data (you can scrub back and forth and the frames are always the same). A 3D model could also be considered a document, even if you can fly through it, even if it's got a looping or scrubbable animation.
Say I write a static html page that loads a series of images down the page where one image will fit on your screen at any time. If the browser loads them all into memory at once without releasing the memory or maintains the a fully rendered virtual page out of sight, is that bloat the app or runtime fault?
Then the browser/runtime should optimize that as much as possible.
I suppose, sure, static webpages are closer to "documents" than "apps" and they should work well 'out of the box' without adding heaps of JS to optimize the browser's difficiencies.
It's a difficult question because there are so many factors in dom/css that change the answer to 'is there a chance that the image should be rendered the next frame?' that it becomes really hard to implement a strategy for what content to offload to disk and when
If the runtime fails to load the offloaded data back in time there will be visible rendering artifacts so you really have to make sure your strategy is robust
If the static page is badly written and does not instruct the browser to use lazy loading (using the loading="lazy" attribute on the img tag) and the browser loads them all at the same time, is that a problem with the page or the browser?
Lazy loading for images was only introduced around 2019, not every website out there will have been updated since (and retroactively become “badly written”).
It is also not on by default, because the platform itself is too conservative and the implementation doesn’t allow zero breakage changes of defaults like that.
The tooling culture around HTML also isn’t such that you’d be prevented from deploying a site if you can use it but don’t, at least you’re not railroaded towards that.
Lazy should have been the implicit default and we should have gotten loading=“eager” instead. Same with having sane calendar controls, dropdown and collapsible controls, video controls so good we wouldn’t need vendor equivalents, light boxes for images and so on.
The view of web pages as apps and browsers as runtime environments/OSes is reasonable but in my opinion it even reinforces the idea that it should be the browser duty to contain bad behavior from web apps/pages. Browsers are well positioned to do so, as they know exactly which resources are used by each tab , and how those grow over time. Also browsers already treat web content as untrusted (sandboxing, isolation), so it would be a natural next step to extend that approach to resource usage. It would match how Operating Systems work, where it's the OS acting as an "arbiter", not the userland application.
It is non trivial to determine if ressouces a site is using is reasonable or not. A web game may use lots of ressources and will crash if the OS suddenly decides to take some memory away.
I would love it if all the major browsers would agree on this. "Every tab is only allowed up to 100mb of memory, if a page needs more than that, optimize it." - Though a setting from the user to allow it for, say, online videogames or streaming sites or something, would be a good idea.
1. It would break a very large number of existing sites.
2. The vast majority of users aren’t able to make an informed decision.
3. Browsers already have heuristics to inform users about misbehaving tabs and suspend them.
4. It hurts performance. More pressure on gc, more cache thrashing
It’s all about the UI. The browser vendor could make the informed guess and say “we think this web page is using too many resources”. Certainly Google could ascertain this during its spidering. Browsers already have several similar interventions e.g. no https, script taking too long etc.
Regardless, if it improved the experience then it becomes like Firefox was in the beginning, and Chrome in the beginning, a better performing competitor about to eat market share.
I think the Corvette once had a special key for driving with enhanced performance, or maybe the key had to be turned to another position, I don't remember which. That caused so many service calls that later 'Vettes dropped it. And in the case of the Corvette, we're already talking about an enthusiast community that ostensibly actually takes an interest. Not so with people who call their browser "the internet".
Agree, most people just want to visit a site and use it. Don't want to be bother with permission requests. You read the permission request the first 2, 3 times. Then just allow forever and you are back to the same scenario
None of the major browsers have done this because they are prisoners of web devs, and now completely ignore user satisfaction to drive developer satisfaction.
My web browser runs on my computer and should do what I tell it to. Nobody else, just me.
The minute someone releases a browser that works that way they'll have whatever money they want to charge me for it. For now even Firefox does all sorts of anti-consumer nonsense and enforces all sorts of client side 'rules' it never should have so webdevs can protect their "rights" at my expense.
In the early days of the internet this kind of made sense. People had the "if devs don't trust the internet nobody will use it" argument. Now I think it's time to say "If users can't trust their own computers they won't use them."
I'm tired of living in Sagans demon haunted world.
I remember when I was a Safari user, any instance of Slack I had open would get reloaded after 5 – 10 minutes with the message "this web page was reloaded because it was using two much memory", interrupting whatever I was doing.
My computer had many gigabytes of memory, so I always found this very annoying. Like, yes, Slack is a giant memory hog and that really sucks, but I can't exactly do anything about that.
Maybe Google would have the clout to actually enforce a memory limit like this, but I'm not sure whether anyone else does at this point. Apparently even Apple wasn't big enough.
Actually Safari is the only browser with that clout because it's the only one available on iOS and for some reason people still care about iPhones. If Google did this they'd probably just lose back to Firefox and Edge.
Though I agree, I am grateful that services such as my banking and national insurance are available via the browser and do not require me to install their own apps on each device. I have no banking apps on my phone nor desktop, Firefox is my window to all those services. I can put my trust in Firefox, I would not put my trust in each outsourced app each for each service I use.
Back in the days we've had generic interfaces to banking, e.g. HBCI, and there were optimised apps from reputable companies written in actual programming languages that compiled into optimised code. Running on the actual operating system without any weird abstraction layer in between. And it all even worked with a few MEGAbytes of RAM. AND that one app could talk to ALL of your banks. (And if you didn't like that one app, there was another one with a similar feature set.)
Runtimes can have bugs or inefficiencies that cause them to use more memory than strictly necessary, but by and large most memory problems are the product of the apps (or webpages) themselves.
Replies (6)
I've been championing this mind set for nearly 20 years now. The message was more clear in the Flash era, but once you realize that your webpage is an (/a desktop) application that only happen to live in a browser - it makes a lot of reasoning and designing a lot easier.
Replies (1)
I don't want to tell you you've wasted your time but it's fairly obvious that webpages are sometimes documents, sometimes apps and sometimes a hybrid between the two. For example, YouTube is clearly an app, but a webpage written predominantly in HTML and CSS is much more of a document than an app.
Replies (2)
Replies (2)
I hope we can move past the movement of everything should be a web app.
Replies (1)
i'm not trying to be glib, i get what you mean, i just wonder if you have an actual criteria. I've been struggling with this from time to time over the years.
Replies (4)
I would say a contained set of words, sometimes accompanied by static visual data (e.g. images), which aimed to convey ideas or information.
For example, a post on a recipe blog website can be seen as a document, even if there are sometimes some interactive elements (like being able to change ingredient amounts based on desired portion sizes), and even if there's usually a CMS behind the scenes helping the website author update their recipes, as the written recipe is at the core of what is being transmitted.
On websites the wide array of interactive elements do blur the lines between documents and apps, but the web was designed as a document sharing medium first and had app functionality bolted onto it afterwards. It's perfectly possible to have a website with zero JavaScript.
I don't know if that fully answers your question, but hopefully it's of some use.
Replies (1)
normally, when i think of a document, i think of something that is to be printed / printable properly. this puts javascript out of the picture for the most part, though not necessarily entirely. some pages sadly don't even load their content without javascript these days, like SPAs, or require custom streaming.
i needed to print directions from google maps one time for example, and even the inbuilt solution is basically just a fancy print screen of a page that was mostly rendered with javascript (or similar, i don't know their tech stack, not necessarily relevant). but then this brings about the idea that the page can be interactive, while exposing an end result that is printable.
or consider css. modern css has animations. one can even implement a navbar without any js, just pure css (and i very much appreciate when people do!). i'd permit media queries, but i'm not sure about fancy animated effects.
another thing i might want to bring up is grafana. it's just interactive charts. if i disable the autorefresh, it's not live either. requires javascript, but i believe if someone wanted to chart something some other way that is not grafana, it's possible to do some visualizations with just css alone as well in a way that is manipulable. end result is again static. i could conceivably print it.
i'm not even sure pure html, with no embedded js and css, escapes the non-document fate guaranteed. video tags include videos after all.
for me the bigger question is usually how much arbitrary execution a website requires instead. if it's all fixed function stuff, like html or css, i'd grade that higher than i'd websites requiring arbitrary code execution. but then technically modern fonts are also virtual machine bytecode that is executed during font rendering, so even just putting text on the screen can require arbitrary code execution. and even if we don't go that far, you do need to hold onto some state, since html is not a regular language for example (cue can't parse html with regex meme). and this isn't even getting into all the weird and whacky multimedia formats.
Continue this thread (1 replies) →
IMHO the distinction is on interactivity, if I'm expected to click around to change state (not just get to other page) then its an app, if not, it's a document.
Seems like one required criterion, maybe even the most important criterion, is that a document is static. It can be displayed in a way that changes with time (such as playing video) but it's a dynamic view over static data (you can scrub back and forth and the frames are always the same). A 3D model could also be considered a document, even if you can fly through it, even if it's got a looping or scrubbable animation.
Say I write a static html page that loads a series of images down the page where one image will fit on your screen at any time. If the browser loads them all into memory at once without releasing the memory or maintains the a fully rendered virtual page out of sight, is that bloat the app or runtime fault?
Replies (3)
Runtime can certainly be optimized, but the app can also virtualize or force unloading if it needs to.
Replies (1)
Replies (1)
I suppose, sure, static webpages are closer to "documents" than "apps" and they should work well 'out of the box' without adding heaps of JS to optimize the browser's difficiencies.
If the runtime fails to load the offloaded data back in time there will be visible rendering artifacts so you really have to make sure your strategy is robust
Replies (1)
Lazy loading for images was only introduced around 2019, not every website out there will have been updated since (and retroactively become “badly written”).
It is also not on by default, because the platform itself is too conservative and the implementation doesn’t allow zero breakage changes of defaults like that.
The tooling culture around HTML also isn’t such that you’d be prevented from deploying a site if you can use it but don’t, at least you’re not railroaded towards that.
Lazy should have been the implicit default and we should have gotten loading=“eager” instead. Same with having sane calendar controls, dropdown and collapsible controls, video controls so good we wouldn’t need vendor equivalents, light boxes for images and so on.
Replies (3)
Replies (2)
Replies (2)
Replies (1)
Regardless, if it improved the experience then it becomes like Firefox was in the beginning, and Chrome in the beginning, a better performing competitor about to eat market share.
Continue this thread (1 replies) →
Replies (3)
I think the Corvette once had a special key for driving with enhanced performance, or maybe the key had to be turned to another position, I don't remember which. That caused so many service calls that later 'Vettes dropped it. And in the case of the Corvette, we're already talking about an enthusiast community that ostensibly actually takes an interest. Not so with people who call their browser "the internet".
Continue this thread (1 replies) →
Continue this thread (1 replies) →
My web browser runs on my computer and should do what I tell it to. Nobody else, just me.
The minute someone releases a browser that works that way they'll have whatever money they want to charge me for it. For now even Firefox does all sorts of anti-consumer nonsense and enforces all sorts of client side 'rules' it never should have so webdevs can protect their "rights" at my expense.
In the early days of the internet this kind of made sense. People had the "if devs don't trust the internet nobody will use it" argument. Now I think it's time to say "If users can't trust their own computers they won't use them."
I'm tired of living in Sagans demon haunted world.
My computer had many gigabytes of memory, so I always found this very annoying. Like, yes, Slack is a giant memory hog and that really sucks, but I can't exactly do anything about that.
Maybe Google would have the clout to actually enforce a memory limit like this, but I'm not sure whether anyone else does at this point. Apparently even Apple wasn't big enough.
Replies (1)
Replies (1)
Replies (2)
The internet was a better place when webpages were not seen as "apps."
Replies (1)
Replies (1)