points by getcrunk 1 year ago

For a new project I wonder how much simpler (or secure) a browser could be made if you only allowed a subset of js and browser apis.

I’d wildly guesstimate for 70% of use cases you wouldn’t even need 50% of stuff with some slight modifications. The web is just so bloated.

Edit: might as well prune down the css a little too and maybe dump wasm, webgl and canvas

jsheard 1 year ago

The problem with targeting a subset is there's a ratchet effect with web APIs, once support reaches critical mass in the major browsers sites will start unconditionally relying on those features and there's no going back from there, any new browser has to also support those features or be considered broken.

I suppose anything that's gated behind a permission prompt in Chrome/Firefox/Safari could be culled without too much trouble at least.

  • starbugs 1 year ago

    > The problem with targeting a subset is there's a ratchet effect with web APIs

    What about starting a new web then only for the supported subset?

    Based on my current browsing experience, this may be a plus in the long run.

    • peremptor 1 year ago

      There are now 3 competing standards.

      • darby_nine 1 year ago

        You really just need two to see the positive effects, but three would be fantastic.

    • gus_massa 1 year ago

      The problem is convining anyone to write a website in this. You will have like 3 sites that use only the subset.

      The closest example is AMP, but you must be Google to force people to use it.

      • starbugs 1 year ago

        > The problem is convining anyone to write a website in this

        Could choose a subset that lets certain sites that do not get on everybody's nerves still run fine.

        For the remainder, people who need it can run an extension that runs a Chromium converting what's possible to the target subset.

        • immibis 1 year ago

          Do you want to support YouTube? You want to support YouTube, don't you? Any big FAANG site probably uses most of the possible features.

          • starbugs 1 year ago

            > You want to support YouTube, don't you?

            Of course no. You can use a bloated browser for that.

          • dredmorbius 1 year ago

            So long as I can query the site for videos of interest and spin them up under mpv or VLC we're tots fine.

      • galangalalgol 1 year ago

        A surprising number of websites work fine without js.

        • ranger_danger 1 year ago

          Basically none of the ones I use look or work normal without it.

        • niutech 1 year ago

          Websites with text content maybe, but the web is full of webapps which require JS.

    • skriticos2 1 year ago

      There is a reason that Esperanto or one of it's siblings is not the language of global understanding and we are discussing in English. The world at large generally does not care about these kinds of fancy. It's half a miracle that we agreed to whatever the Chromium engine implements to be a baseline that most folks build stuff on.

astrobe_ 1 year ago

Given that a browser is not practically a virtual machine and/or an OS, it is not too surprising that an OS developer is not scared by the task. At the same time, it seems to me that multimedia is a whole different beast.

> For a new project I wonder how much simpler (or secure) a browser could be made if you only allowed a subset of js and browser apis

IMHO the only viable subset is the empty set. There are some surviving HTML-only browsers that are still usable for e.g. viewing documentation or browsing simple-minded websites (like HN, but they are fewer and fewer every year, unfortunately).

I really don't want to drop the all too common negative comment - in particular since I already use an alternative web browser - but the initial investment required just for an MVP seems mind-boggling to me.

I think a basic HTML browser that can automatically delegate all it cannot handle to other apps - PDF viewing to a PDF viewer, video playback to a video player, and JS-requiring things to a big browser - would be interesting (if it already exists, please let me know).

  • bobajeff 1 year ago

    >IMHO the only viable subset is the empty set. There are some surviving HTML-only browsers that are still usable for e.g. viewing documentation or browsing simple-minded websites (like HN, but they are fewer and fewer every year, unfortunately).

    I'm curious if throwing out DOM/js would make the task more approachable. My intuition says yes. But I'm thinking CSS would still make it super difficult. Also I've heard that HTML has some rough areas that make it hard.

    That being said I find Netsurf is pretty capable even if I don't really use it very often. Yeah some pages don't render right but it's really fast. So who knows maybe we can get away with a reduced set of features or better yet go back to using separate clients instead of web apps for things like chat, email and forums.

  • djbusby 1 year ago

    I've been wanting something like that, like a wrapper that hosts three or four engine, so I can use normal for every-day, upscale to FF for some or Chrome for others - all in one UI.

8organicbits 1 year ago

I think this is a great point. The majority of my browsing uses text oriented sites (some think they are more, but I read them in reader mode). As I user, I rarely want more. I'd use a slim, secure browser if I could.

Sometimes I play games, or use "web apps" and using a different tool in those instances would be fine. Back in the early 2000s I remember using Firefox with an "open in IE" extension that allowed me to primarily use FF and fall back to IE when sites were broken. As websites modernized I used the extension less and less.

Also consider desktop apps that use election. Bundling a simpler browser and building the app to the capabilities of that browser could greatly reduce install size and memory usage.

EasyMark 1 year ago

If it only does 70% of what a regular browser does would anyone (seriously not as an experiment) use it on a daily basis? Most people just want to get on the web and go. They don’t care how big their is on disk or how much ram it uses (within reason of course), but the first time it doesn’t render their bank page or Jira page, they will drop it. Obviously I’m not talking about beta testers here or curious web devs.

philistine 1 year ago

The conversation regarding restrictions on the feature set within the browser always focuses on the browser itself, but there is definitely an opportunity to rally website makers. If Google or Apple came out and said we have a reduced feature set you can use that makes our browser render your website faster it would be a good opportunity, and I think many website makers would jump at the opportunity. A sort of Google AMP, but good! Let's call it Strict HTML.

Gazoche 1 year ago

> Edit: might as well prune down the css a little too and maybe dump wasm, webgl and canvas

Alternative idea: go the other extreme and stop pretending modern browsers are anything else than virtual machines. Turn browsers into sandboxed VMs that only run Wasm, with backwards compatibility ensured by shared wasm libraries that render HTML and run JS.

hypeatei 1 year ago

This is so wildly wrong it hurts. As soon as that one important website (to your user) breaks, they will switch browsers.

Just deciding that you don't want to implement >50% of web specs "for simplicity" and expecting that to be a winning strategy is very HN.

  • hollowturtle 1 year ago

    To me it’s not wrong at all, why won’t a simpler browser with a “modern mode” rendering succeds? There is no need for that browser to support the space jam website, who really cares? Imo thinking that people need quirks mode because they need to visit old website it’s very HN.

    • IggleSniggle 1 year ago

      It's not that at all. Imagine some popular website is relying on some weird quirk but it works out in modern browsers. They don't even know they are broken, or in what way, and first discovering the issue and then investing in fixing the issue for <1% of readers is a very difficult cost to justify.

  • sanitycheck 1 year ago

    The "very HN" thing for me is assuming a "winning strategy" has to be mass adoption. There's room for a smaller web full of nerds and geeks, we had that before and maybe we can have it again.

    • immibis 1 year ago

      Indeed, that's why we are discussing on HN, not on Reddit. Exclusion as a design choice.

niutech 1 year ago

This is what Sciter, Lexbor or litehtml are aiming for.