Ok, so I’ve been thinking for a bit, and I know there’s a ton of alternative “libre” frontends for websites like YouTube and Reddit. However, I was thinking: what If I just wanted to make my own frontend? Not specifically for the intentions of “libre”, but I wanted to change the controls and appearence of the website. I’m honestly unsure of how to approach this. Any thoughts?

  • Deckweiss@lemmy.world
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    8 months ago

    A website is just textfiles that your browser downloads. You can open the debug menu and read them, and even edit them. Sometimes the files are minified or obfuscated and you need to use some special tools to make them readable. But the core concept is: the files are on your pc, you can do with them whatever you want.

    If you don’t know how to start, it seems to me that you wouldn’t have enough skill to succeed. So instead I’d suggest you start with what’s called “userscripting” (greasemonkey or similar). Userscripting is a way to modify a website on the fly. For example you could remove some elements, reposition elements, add buttons with new functionality etc. That will let you start with your goal on a small scale, possibly with some compromises from your vision. But you will be able to get into the general workflow and get results in a reasonable timeframe.

    If you want to do it properly you have to study the API, which can be either publicly documented or you have to read the websites source to reverse engineer it. Then you just program a website like usual which uses the API and does something with the results. If there are already open source frontends, and no public API docs, you can read those projects source instead, which is easier than reverse engineering.

    Hope this helps as an entry point

    • g6d3np81@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      I also have a similar side project planned for a revamp. Successfully made a v1 with grease monkey (vanilla JS) + stylish back in maybe 2016. Super dangerous to keep firefox 56 running only for this front-end. Just need to do the v2 then migrate to latest librewolf.

      I want to redo the whole thing in Vue, client side routing with build step. The problem is that

      • site is not open source
      • no API doc (but I already made my own)
      • required log-in (no sensitive info)
      • some route request must be made from that domain due to CORS

      My goal is not to change the UI but wipe the whole page and start over with custom API call instead. V1 do this by visiting a 404 route to stop unnecessary load and use my own URL param for the API call. For bonus cringe I used local storage for database.

      Ended up having to use userscript, and now I’m kinda stuck with how to mash Vite build and tamper/violent monkey together :(
      Do you have any suggestion or resource I can learn more on this?