Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 11y ago · link · parent

There is CSP ( https://en.wikipedia.org/wiki/Content_Security_Policy ) to protect againgst inclusion of unapproved third party scripts. Hash check won't help against malicious WP themes because they would not output integrity attribute into generated HTML.

comment 11y ago · link · parent

CSP header doesn't need to be added for every response, e.g. for images or JS files.

comment 11y ago · link · parent

No. They injected code into some visitor analytics script (like GA) and those scripts are constantly updating so you cannot calculate and store the hash.

comment 11y ago · link · parent

Different sites usually use different versions of libraries. Also nowadays sites use to put caching headers for all their resources so the cache quickly gets filled. I think there would be low cache hit ratio.

comment 11y ago · link · parent

That is absurd. To prevent malicious modifications and data leak you can just host code on your own server. Using free CDN (without SLA) you just increase your site downtime and get nothing in return (well except that company and NSA can now collect IPs, UAs and referers of your users).

CDNs are used to optimize traffic cost but hosting just single JS library there won't save you much.

Calculating hashes is bothersome and requires modification of an app so probably nobody is going to use it.

I never use libraries hosted at free CDNs.

EDIT: I cannot think of a scenario where this feature can be useful.

EDIT 2: And you cannot use this feature for scripts like Google Analytics because they can be modified anytime.

comment 11y ago · link · parent

Why post links that are behind a paywall? This needs to be downvoted.

It may be a great article but why post it here if nobody cannot read it?

comment 11y ago · link · parent

Disabling javascript makes Chromium eat less memory and makes pages load faster. Also all sort of annoying popups, effects, ads and social tracking buttons do not work without it while page content is usually readable. That's why I have JS enabled only for trusted websites like Youtube and disabled everywhere else. It just makes browsing the web more comfortable.

It's sad that Chromium doesn't have a way to disable CSS on a per-domain basis (and browser extensions are potential backdoors so I'm not going to install them).

comment 11y ago · link · parent

I think the problem of lazy loading should be solved by browser vendors (maybe adding some new attribute on img). And it's sad that it doesn't work without JS. Cannot we fix this by using noscript tag?
1
181182183184185