2 ms·
What do you do if you create a website which modifies the dom, but find out what your users have extension XYZ which completely breaks are our assumptions about
by viraptor 11y ago
What do you do if you create a website which modifies the dom, but find out what your users have extension XYZ which completely breaks are our assumptions about what the dom is? For example you just received a server-rendered page which should have "ul/li/span.Foo", but find out that the span is a link now instead, so your JS breaks down.
All of the things you mentioned are websites trying to break your expected behaviour. This is the exact opposite - your extension is breaking the expected behaviour and the website wants you to leave it alone.
- somesomesom 11y agoWhy should I care about what the website owner wants? It's my computer running his shitty Javascript. I get to choose how this client-side Javascript runs because I get to choose how every kind of software runs on my own computer.
- viraptor 11y agoSo basically you're ok with randomly getting broken pages if you use content-modifying browser extensions? If yes, no problem. If it's an issue - something's got to give.
- chao- 11y agoSimple answer: Yes. Longer answer: I install any such extension with full knowledge of their potential to cause breakage, and consequently my first reaction to a broken page is to issue a reload with the extension disabled. The web being programmatically accessible and end-user-malleable is a strength, not a weakness.
- Zarel 11y agoBut many (I'd put my money on "most") users' first reaction isn't to issue a reload with the extension disabled. A lot of users aren't even aware of what extensions they have installed, and their first reaction is to file a bug report to the website. It would be nice if there was some way to prevent users from reporting bugs if they have extensions modifying the website in certain ways, or at least warn them to try disabling their extensions first. I wouldn't even mind a whitelist for certain well-behaved ad blockers, but certain extensions are well known for being bad (many extensions _inject_ ads, which is a recipe for website breakage).
- Zarel 11y agoYes, but most users don't take responsibility for the extensions they install quite that way. The problem comes if you install a browser extension (or acquire malware that installs a browser extension for you), forget about it, and then blame the website when the website stops working, often filing bug reports (increasing the support load of the website).
- Klathmon 11y agoAnd don't forget the bad-mouthing on social media. Just look at hacker news. Many posts have someone complaining how the site is broken only to find out they have disabled scripts or have a night mode extension, or disabled webgl but forgot about it, or they programed their router to drop all packets that were going to a url that included "google" anywhere in it (including mysite.com/google-blog-post, true story)
- na85 11y ago>What do you do if you create a website which modifies the dom, but find out what your users have extension XYZ which completely breaks are our assumptions about what the dom is? For example you just received a server-rendered page which should have "ul/li/span.Foo", but find out that the span is a link now instead, so your JS breaks down. Perhaps you should move away from the "just throw some js at it" mentality and learn to design things in a more robust fashion, so that they don't depend on having to make assumptions about the dom.
- viraptor 11y agoReality test - can you show me a single website which has rich client-side script, gets html or json from the server, and adds a failure path for every single element/property access which does not succeed? (with failure path that doesn't depend on the rest of that content) Because that's what you seem to be suggesting.
- jon-wood 11y agoHow exactly do you propose people should write JavaScript to control their UI which doesn't make at least some assumptions about that UI?