5 ms·
Good lord, I see pages that would break from this constantly...
by airza 8y ago
Good lord, I see pages that would break from this constantly...
- supermatt 8y agoyou constantly see pages with #targetText=blah fragments?
- rolae 8y agoI think he means it the other way around. You have a Single page application with routing based on #someRoute, then someone tries to share some link with the #targetText=... which will lead to an invalid route. Or am I missunderstanding something?
- prepend 8y agoYou’re thinking of ?targetText= or &targetText= Hash isn’t used for query parameters.
- aepiepaey 8y agoNot for query parameters sent to the remote server, but there are definitely pages/applications that store state in the hash. For example, look at the URLs used by mega.nz, or any encrypted pastebin (they store the decryption key in the hash so it's not sent to the server).
- bryanrasmussen 8y agolots of older or poorly written SPAs use the hash exactly in this way. I guess their fault for being poorly written, like those people who allowed GET requests to /deleteaccount based on the theory that you had to be logged in with a browser for it to ever happen and not considering that google would make an extension that did all get requests on a page on entry.
- coldtea 8y agoThey didn't use it because they were "poorly written", it was a "state of the art" technique back in the day. Gmail used, others used it. https://stackoverflow.com/questions/15238391/hash-params-vs-url-params-when-to-use-which https://stackoverflow.com/questions/15238391/hash-params-vs-...
- bryanrasmussen 8y agosure, it was state of the art back in the day, but state of the art over time depreciates to technical debt, and the ones that are left using what was once state of the art are now poorly written.
- coldtea 8y ago>and the ones that are left using what was once state of the art are now poorly written. They could just be perfectly written (for their time), just legacy and not updated, is my distinction.
- bryanrasmussen 8y agoat some point the accretion of legacy and not fixing issues to match better understanding turns a perfectly written for its time application into a poorly written application for the present.
- threeseed 8y agoThat doesn't give Google the right to break all those sites though.
- bryanrasmussen 8y agoright, I guess I should have indicated sarcasm on the I guess it's their fault part.
- Shish2k 8y agoIt is in client-side JS single-page-apps...
- coldtea 8y agoIt was used in SPAs. It was a common technique in the mid-2000s up to 2010 or so. But not for query parameters per se, for app state stored in the query string (and bookmarkable). https://stackoverflow.com/questions/15238391/hash-params-vs-url-params-when-to-use-which https://stackoverflow.com/questions/15238391/hash-params-vs-...
- Guest10928391 8y agoOne that quickly comes to mind... https://store.steampowered.com/tags/en/Adventure/#p=3&tab=TopSellers https://store.steampowered.com/tags/en/Adventure/#p=3&tab=To...
- supermatt 8y agodoesnt seem to break on addition of a targetText "hash-param"
- palerdot 8y agoBackbone JS uses hash for routing. Case in point - http://backbonejs.org/#Router http://backbonejs.org/#Router. There should be lot of sites that uses hash params as routes which still exists from the early SPA era.
- xg15 8y agoThis assumes all SPAs would ignore unknown parameters they see in the fragment part. Even if the SPA itself doesn't use "targetText", it could still try to validate the fragment and abort with errors on unknown data present. Also, this would require the "targetText" parameter to live peacefully alongside other parameters. (That in turn would require there were a standard definition of "parameter" inside the fragment at all) E.g, if Chrome encounters an url with an existing fragment, it would somehow have to combine this with its own targetText parameter and hope the SPA still understands the combined fragment.
- airza 8y agoYes, in particular many B2B web apps' help systems (looking at you, adobe) do very unholy things with these fragments.
- bokan 8y agoWhich is exactly why we build an experiment first, to find potential issues before shipping. If you do see a page that you think might break and you're on Chrome newer than 74.0.3706.0, try turning on chrome://flags#enable-text-fragment-anchor and giving it a try. If something looks out of place, that would be extremely useful data for us. File a bug either at https://github.com/bokand/ScrollToTextFragment/issues https://github.com/bokand/ScrollToTextFragment/issues or https://crbug.com/new https://crbug.com/new