So, I am one of those old school types who mains with Firefox and Noscript. And also a filthy casual that just goes on lemmy.world. But half the images are broken because I'm expected to allow scripts on like 30+ sites to see most of the posts. I'm literally expected to allow /all/ the scripts from a domain just so I can see a dang picture behind the thumbnail. That's the entirety of the scripting needed. That seems ridiculous. Is there, I don't know, a server/way that makes it so I don't have to blanket allow all these scripts? To put it in meme form (not sure I'm doing it right, never seen the show): "It's an image of a banana Michael, what should it take, one Raspberry Pi running Docker?"

[EDIT 6/1/25 - thanks to everyone who commented on this. Screenshots: https://lemmy.world/comment/17403335 ]

you are viewing a single comment's thread
view the rest of the comments
[–] 47 points 1 year ago (3 children)

Yes.

PieFed uses very minimal javascript (it 95% works with JS entirely disabled) and you can access all the same communities and posts.

Try it at https://piefed.social/ or any of these other instances - https://join.piefed.social/try

  • source
  • hideshow 6 child comments
  • [–] 6 points 1 year ago (1 child)

    Just curious, what's the 5% that doesn't work with JS disabled?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 18 points 1 year ago (2 children)

    Voting, lol. Kinda important.

    Dropdown menus. They're not really needed but life sucks without them.

    Can't manually switch between dark and light mode (only automatically based on browser settings).

    There's probably more but I haven't seriously tried to use PieFed for long without JS. Fundamentally it's built HTML and CSS first, with sprinkles of JS added on for funsies rather than the modern way of being all about JS.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 1 year ago* (1 child)

    Yesterday:

    <nav script="dropdown.js" style="dropdown.css">
      <button onclick="toggleDropdown()">Menu</button>
    </nav>
    

    Today:

    // index.js
    import React from 'react';
    import ReactDOM from 'react-dom';
    import './global.css';
    import App from './App';
    
    ReactDOM.createRoot(document.getElementById('root')).render(<App />);
    
    // App.jsx
    import Dropdown from './components/Dropdown';
    import './App.css';
    
    export default function App() {
      return (
        <main>
          <Dropdown />
          <p>Hello, world!</p>
        </main>
      );
    }
    
    // components/Dropdown.jsx
    import { useState } from 'react';
    import styles from './Dropdown.module.css';
    import ArrowIcon from '../assets/icons/ArrowIcon.jsx';
    
    export default function Dropdown() {
      const [open, setOpen] = useState(false);
      return (
       <div className={styles.dropdown}>
          <button onClick={() => setOpen(!open)}>Menu <ArrowIcon /></button>
          {open && (
            <ul>
              <li>Option 1</li>
              <li>Option 2</li>
            </ul>
          )}
        </div>
      );
    }
    
  • source
  • parent
  • hideshow 2 child comments
  • [+] 5 points 1 year ago* (last edited 1 year ago) (2 children)
  • [–] 2 points 1 year ago

    Yeah. But in this case the Topics menu can be quite heavy as it lists every community that the current user is subscribed to. Instead of generating that menu (and sending it to the client) on every page load, when it probably won't even be used, PieFed makes an ajax call (only possible with JS) to retrieve the topics menu when it's clicked. Same for 'Feeds'.

    This cut the amount of HTML being sent to the browser by around 50% (depends on how many communities you subscribe to but PieFed makes it extremely easy to subscribe to dozens of communities with a single click so many people have hundreds) and eased load on the server too. Some of the more under-powered instances run noticeably faster now.

  • source
  • parent
  • [–] 2 points 1 year ago (1 child)

    Voting

    You could support this by making vote buttons submit a form if JS isn't enabled. (That's what mlmym does.)

    Can't manually switch between dark and light mode

    Hmm... There are some pretty nifty things you can do with a hidden checkbox, label, and some clever CSS (e.g. html:has(#element:checked) + CSS variables -- though FYI :has is baseline 2023.)

    Making it persistent would require some more effort -- e.g. form + cookies + server side style sheet selection, most likely. mlmym lets users change their theme w/o JS by submiting a form on the setting page. I'd have to think a bit if there's a good way to make it persistent across multiple requests for logged out users with a CDN caching things in between though...

    only automatically based on browser settings

    Doesn't actually work for me in a FF138-based browser w/ JS blocked via NoScript -- I always get light mode despite having a dark mode preference set. (Where do you have your prefers-color-scheme media query?)

    Also, FYI I had to manually override font restriction -- otherwise all your buttons end up as tofu characters. (I think NoScript is being kind of unreasonably strict there by blocking first party fonts.) That's a papercut kind of issue, but figured I'd point it out in case it might save you some debugging time if you get confused NoScript users in the future.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago

    Yeah I think it'd be worth getting the voting buttons working, those are pretty key functionality.

    The icons being stored in a font is kinda problematic (some browsers choke, large font file) but on the other hand it's so great being able to set the color of them in CSS, which I found difficult when they are a SVG.

  • source
  • parent
  • [–] [S] 3 points 1 year ago (1 child)

    Looks nice is my immediate impression (looking at it with all javascript off, including ). Still would like thumbnails that are the entire image just much smaller, maybe via CSS. The cropping is very misleading on a lot of images. Perhaps one could use css-toggle-switch--not going to try to solution it, and I know last time I checked css wasn't great for it. But the results are notably different from lemmy.world for Active or Top past 12 hours. Not necessarily /bad/, particularly for top posts as they at least have a bit of engagement. But it seems like part of the solution is just don't incorporate results from servers that require javascript. Is it possible (ethical even) to incorporate them, but be a middle-man that saves the user from their javascript?

  • source
  • parent
  • hideshow 2 child comments