News for hackers. Stuff that matters.
Re:React Armor: Protect your DOM from third-party tampering by viraptor on Monday February 29, 2016 @11:12PM (#11200734)
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.

Re:React Armor: Protect your DOM from third-party tampering by somesomesom on Monday February 29, 2016 @11:16PM (#11200745)
Why 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.

Re:React Armor: Protect your DOM from third-party tampering by Zarel on Monday February 29, 2016 @11:51PM (#11200852)
Yes, 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).

Re:React Armor: Protect your DOM from third-party tampering by Klathmon on Tuesday March 01, 2016 @05:44AM (#11201924)
And 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)

Re:React Armor: Protect your DOM from third-party tampering by viraptor on Monday February 29, 2016 @11:23PM (#11200765)
So 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.
Re:React Armor: Protect your DOM from third-party tampering by chao- on Monday February 29, 2016 @11:33PM (#11200798)
Simple 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.

Re:React Armor: Protect your DOM from third-party tampering by Zarel on Tuesday March 01, 2016 @12:29AM (#11200948)
But 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).

Re:React Armor: Protect your DOM from third-party tampering by na85 on Tuesday March 01, 2016 @12:05AM (#11200895)
>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.

Re:React Armor: Protect your DOM from third-party tampering by viraptor on Tuesday March 01, 2016 @12:25AM (#11200941)
Reality 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.
Re:React Armor: Protect your DOM from third-party tampering by jon-wood on Tuesday March 01, 2016 @03:47AM (#11201499)
How exactly do you propose people should write JavaScript to control their UI which doesn't make at least some assumptions about that UI?