Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Linux
  3. Clean all URLs in clipboard

Clean all URLs in clipboard

Scheduled Pinned Locked Moved Linux
27 Posts 11 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • meekah@lemmy.worldM [email protected]

    As a WebDev... URL parameters are definitely not the place to keep state... Were not in the 00's anymore. They do have legit uses, but we have JS localStorage nowadays.

    T This user is from outside of this forum
    T This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #21

    They have pretty different use cases. Localstorage is for when you want persistence across page loads, not necessarily specific to any particular page but specific to a browser. An example would be storing user-selected light or dark mode.

    Query parameters are specific to a page/URL and you get a lot of things for free when you use them:

    • back/forward navigation
    • bookmarking
    • copy-paste to share
    • page level caching
    • access on both server and client

    Query parameters are good for things like searches, filters, sorting, etc

    meekah@lemmy.worldM 1 Reply Last reply
    0
    • T [email protected]

      They have pretty different use cases. Localstorage is for when you want persistence across page loads, not necessarily specific to any particular page but specific to a browser. An example would be storing user-selected light or dark mode.

      Query parameters are specific to a page/URL and you get a lot of things for free when you use them:

      • back/forward navigation
      • bookmarking
      • copy-paste to share
      • page level caching
      • access on both server and client

      Query parameters are good for things like searches, filters, sorting, etc

      meekah@lemmy.worldM This user is from outside of this forum
      meekah@lemmy.worldM This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #22

      I disagree. I definitely prefer REST APIs that use the file path for searches, filters, sorting. You get most if not all benefits from query parameters, and if done correctly it is just as clearly readable as query params.

      T 1 Reply Last reply
      0
      • meekah@lemmy.worldM [email protected]

        I disagree. I definitely prefer REST APIs that use the file path for searches, filters, sorting. You get most if not all benefits from query parameters, and if done correctly it is just as clearly readable as query params.

        T This user is from outside of this forum
        T This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #23

        But what if you have multiple optional parameters?

        meekah@lemmy.worldM 1 Reply Last reply
        0
        • T [email protected]

          But what if you have multiple optional parameters?

          meekah@lemmy.worldM This user is from outside of this forum
          meekah@lemmy.worldM This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #24

          have multiple routes point to the same endpoint, dynamically adding the parameters serverside

          T 1 Reply Last reply
          0
          • meekah@lemmy.worldM [email protected]

            have multiple routes point to the same endpoint, dynamically adding the parameters serverside

            T This user is from outside of this forum
            T This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #25

            That sounds harder than just using query parameters. What are the benefits?

            meekah@lemmy.worldM 1 Reply Last reply
            0
            • T [email protected]

              That sounds harder than just using query parameters. What are the benefits?

              meekah@lemmy.worldM This user is from outside of this forum
              meekah@lemmy.worldM This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #26

              Having more beautiful and structured URLs. I suppose for those cases it's more of a preference, and with the tooling I use (.NET) it's not too difficult to achieve.

              I guess my gripe with your original statement was that I was thinking mostly of state like user login etc. I have to concede it's not totally garbage for the cases you mentioned.

              1 Reply Last reply
              0
              • meekah@lemmy.worldM [email protected]

                I know firefox has the very useful "Copy clean Link" option in the context menu, but I would like a similar feature for copying links from any other software, like spotify for example. So I am looking for some software that hooks into the clipboard pipeline, and cleans any URL that gets added. I tried googling for something like it, but was completely unsuccessful. Does anyone have a clue how I might go about achieving this?

                Thanks in advance 🙂

                U This user is from outside of this forum
                U This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #27

                Looks like https://old.reddit.com/r/kde/comments/d3m0fz/how_to_open_links_in_mpv_with_klipper/ is a good starting point, i.e

                • Open menu in system tray.
                • Right click on Clipboard => Configure Clipboard.
                • Go to Actions Configuration => Add Action.

                then... to try! 😄 I'm just discovering this too but seems like the right way.

                That said I'd be cautious and limit the use case to only what you have, e.g. Spotify links, at least at first because I imagine one can get into hairy edge cases quickly.

                Keep us posted!

                1 Reply Last reply
                0
                • System shared this topic on
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups