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 7y ago · link · parent

Please notice that there also are requests to suspicious Western sites like Google as well, which were caught for collecting data before.

I have examined network traffic from my Chinese noname phone, and it also sends data to Chinese servers and to Google.

Also when you visit most websites, there will be a request to Google's data collector service.

comment 7y ago · link · parent

Also, Escape key won't work if you had pressed F11 to switch to a fullscreen mode. Furthermore, browsers like Opera remember this setting and restore fullscreen mode (along with the page content) even after restart. I saw a case when a user somehow has opened a page with ads in fullscreen mode (probably it was done for watching a movie) and it was restored even after exiting and restarting the browser. So I killed the browser with Task Manager, restarted it and the fullscreen ads appeared again.

I (an experienced user) couldn't quickly figure out that it was actually a fullscreen mode, couldn't understand why the browser doesn't launch and thought it was some kind of virus in the system. I figured it out only when I tried to move mouse upwards and a browser UI appeared.

comment 7y ago · link · parent

Also such sites sometimes play audio instructions trying to scare or deceive a user.

comment 7y ago · link · parent

Ok, I got it. We just don't have such animals here, and volwes, who could catch a cat, are rare.

comment 7y ago · link · parent

The spec [1] says:

> Richly interactive web sites, games and remote desktop/application streaming experiences want to provide an immersive, full screen experience. To accomplish this, sites need access to special keys and keyboard shortcuts while they are in full screen mode so that they can be used for navigation, menus or gaming functionality.

But I guess it will be used by scammers as well.

[1] https://w3c.github.io/keyboard-lock/#introduction

comment 7y ago · link · parent

Recently Reddit began to insert a huge "you want to see this too" block into the comments section (at least for unauthenticated users). What an awful solution. People don't want to see our links in the sidebar so let's put them directly into content.

They think that I am a monkey that came from Google search and is going to click links that they show to me.

comment 7y ago · link · parent

I avoid Quora links in search results because it hides content from unauthenticated users and I don't understand why I have to register only to read the answers. Stackoverflow is so much better.

I wonder what is the motivation for the users to contribute to a site that hides their knowledge from others?

comment 7y ago · link · parent

One of the sites opened fullscreen mode to hide browser UI. Note that currently web browser developers are implementing a fullscreen mode with keyboard lock that is much harder to leave because it blocks most of system key combinations: [1]. The only keys that will still work are Ctrl + Alt + Del or holding an Esc for two seconds. And as I assume you cannot leave it using mouse or touchpad.

Another problem is that browsers are tol complicated. Building Firefox from source requires you to have a powerful machine with multicore CPU and lot of memory and comilation would take a lot of time. This could stop people from contributing fixes.

[1] https://www.chromestatus.com/feature/5642959835889664

comment 7y ago · link · parent

Isn't 5 years for a homeless cat? I doubt that a cat that has a home and food would live so little.

comment 7y ago · link · parent

In the countryside in Russia dogs are usually on the chain and don't run outside the yard, but cats have always been free and nobody would even think of locking them in the house. How is it going to catch mice and birds that destroy crops?

comment 7y ago · link · parent

This is a hack to accelerate heavy websites. If your site is lightweight you might not need it. Or you can load such JS code later in an unobstructive fashion.

comment 7y ago · link · parent

Caching helps if you visit several pages on the same site. But AMP might be optimized for scenario when you scroll through several AMP pages from different sites in the search results. Using an external stylesheet would only make loading slower in this case. Another problem is that on an unreliable connection external CSS can fail to load.

comment 7y ago · link · parent

If you visit several pages on a single website, then yes. But if you want to scroll through AMP pages from different websites in the search results, caching doesn't help much.

comment 7y ago · link · parent

> The most important feature of AMP is that it makes it impossible to add the kind of bloated crap that causes poor performance on something like a large media company website.

When I load this AMP page [1] with an empty cache, Dev Tools show that 3.3 Mb of files are loaded [2]. Also, the page contains lots of errors [3]. This page contains ads, analytics and even a video that you have mentioned in your comment.

After loading, every 10 seconds a HTTP2 request to cloudapi.imrworldwide.com is sent even if the page is in the background.

AMP looks more like an internal Google standard for integrating websites into search results. The spec contains a lot of restrictions like these: you MUST include a 12 000-line JS script from Google ( https://cdn.ampproject.org/v0.js ) into every AMP page, you MAY use only components made by Google and even custom JS template engine made by Google. If you are an ad network then you have to make negiotiations with Google, your competitor, to be included into the whitelist. There are lot of whitelists: list of sites that can provide fonts, list of sites that can add widgets to AMP pages.

Here is one example of such conditions [4]:

> In order to qualify for inclusion, an extended component that integrates a third-party service must generally meet the notability requirements of the English Wikipedia, and is in common use in Internet publishing. As a rough rule of thumb, it should be used or requested by 5% of the top 10,000 websites as noted on builtwith.com, or already integrated into oEmbed.

If you are a small business, you are not welcome.

[1] https://amp.theguardian.com/us-news/commentisfree/2016/feb/1...

[2] https://imgur.com/RGYij9q

[3] https://imgur.com/j1IYaMW

[4] https://github.com/ampproject/amphtml/blob/master/3p/README....

comment 7y ago · link · parent

I tried to look at an example AMP page here [1]. When loading with an empty cache, it loads 5.5 Mb of files. I don't see where are the optimizations.

It uses a custom font. Custom fonts are absolutely unnesessary for a news page; they only delay the moment when text becomes visible. Standard Windows fonts are of a good quality and don't need a replacement (which often renders very poorly on Windows XP).

It uses a lot of scripts. Script block some browsers while parsing and executing.

It has SVG images embedded into the page. If you want the page to load faster, you should move images into external files.

AMP is directly linked to Google and cannot be used without it. Please look at the requirements for AMP HTML documents: [2]

> AMP HTML documents MUST ... contain a <script async src="https://cdn.ampproject.org/v0.js"></script> tag inside their head tag.

So every AMP document MUST load a Google-controlled script. And by the way, it contains 12 000 lines when beautified. It contains different Google URLs like 'https://ampcid.google.com/v1/publisher:getClientId?key=' or 'https://ampcid.google.com/v1/cache:getClientId?key=AIzaSyDKt... , references to Doubleclick and AdSense (but not other ad networks). Does every site need it?

It contains a lot of code not necessary for most websites. For example, a XHR interceptor for "some trusted AMP viewers" [3] is included into the script. Or a cryptographic library for calculating sha hashes [4].

You can use only JS components approved by Google; the spec says:

> Extended components

> The script URL must start with https://cdn.ampproject.org

So for example, Google might make a custom component for Facebook but not for QQ or Mixi. Google defines what widget can appear on an AMP page. If you are an ad network, you have to make negotiations with Google to be added (you have to negotiate with your competitor). If US government imposes sanctions on some foreign site, Google will have to comply.

It is clearly a technology made for integrating news articles into a Google page (and judging by limitations in the spec, Google might plan to make a non-vebview native renderer for AMP pages). Don't believe when they try to pretend that it can be used independently as a standard or made for accelerating the web.

[1] https://amp.theguardian.com/us-news/commentisfree/2016/feb/1...

[2] https://www.ampproject.org/docs/fundamentals/spec

[3] https://github.com/ampproject/amphtml/issues/11294

[4] https://github.com/ampproject/amphtml/blob/master/src/servic...

comment 7y ago · link · parent

AMP is used mostly to get higher visibility on Google. Imagine if there was a third-party AMP caching website. Would anyone make an AMP version for them? No way. They do it only because Google will show them above their competitors in search results.

comment 7y ago · link · parent

This is a serious issue with Chrome Store. Google doesn't properly warn users that the store is not premoderated and can contain malware. Instead, they have made a colourful positively looking site without necessary warnings.

comment 7y ago · link · parent

Why don't they arrest US citizens who sold those US products instead?

comment 7y ago · link · parent

But other countries might have similar rules too. For example, Russia has sanctions against Ukraine, and Western companies generally ignore them. Also, Russia has Internet control laws and companies like Google are disrespectfully not complying with them.

Also, under Russian laws companies like Google or Facebook must keep Russian users' data in Russia; they are not complying.

comment 7y ago · link · parent

So if some Western company would trade with Ukraine or Georgia in violation of Russian sanctions, should their representatives be arrested and extradited to Russia?

Also, after Russia-Ukraine conflict many Ukranian politicians are under a criminal investigation in Russia (and I guess Russian politicians are investigated in Ukraine). Should they be extradited too?

comment 7y ago · link · parent

China can always pass a necessary law so that Western citizen will become guilty in full accordance with the law. And US can do the same. There is no difference.

comment 7y ago · link · parent

I think that other countries should improve their cooperation and arrest Western citizens breaking their laws. So that Western citizens and companies that break Chinese, Russian or Iranian laws and violate their trading sanctions, cannot evade a fair trial.

It is annoying to read news like this. US is not a world's police. They should not be telling foreign citizens with whom they should or shouldn't trade.

comment 7y ago · link · parent

So Facebook finds it normal to secretly collect information about users' calls and tons of other information but doesn't like when someone publishes information about their shady deeds.

Press is not doing even a thousandth part of what Facebook has done to others.

4284.

Paypal might be disclosing user's name by email(translate.google.com ↗)

4 points · by codedokode · 7y ago · 1 comment

comment 7y ago · link · parent

That is a function made by MySQL developers [1]. Why don't you blame Sun or Oracle or a Swedish company whose name I don't remember for this?

[1] https://dev.mysql.com/doc/refman/8.0/en/mysql-escape-string....

comment 7y ago · link · parent

I don't think that reading through millions lines of code is a sane idea. Therefore I suggest an alternative to author's opionion:

- select a Linux distribution one can trust, like Debian

- throw away your Node.JS and switch to PHP. We have frameworks like Symfony made by a company that can be trusted and that has proper code review processes so you don't have to worry that tomorrow there will be a backdoor

Another alternative would be a community code review. Everyone using OSS code can contribute some time for a review of the project they like the same way they contribute the code. Reviewing is even easier than writing a code. Then they sign the lines they have checked. It would also help to find poorly written, difficult to understand code and find unreliable code that can contain vulnerabilities.

The companies using OSS code could be interested in this. They would prefer to use the code checked by other corporations rather than the code that has never been reviewed. And they probably are already doing the reviews privately so it wouldn't cost them anything.

comment 7y ago · link · parent

Card information has no value because it is very easy to reissue a card. Things like name or phone number, or address, cannot be changed so easily and have much higher value.

comment 7y ago · link · parent

If they didn't keep the data from long ago, then the damage would be much smaller. Such companies definitely need some help from lawmakers. Companies shouldn't keep personal information for years.

comment 8y ago · link · parent

Apple also has a case where it transferred Chinese users' data to China government.
1
142143144
185