4

As a UX engineer, I try to stay current with best practices.

I noticed that Facebook recently changed their HTML to be scrambled for the datetime of a post.

I'm wondering why that would be a good practice.

The screenshot below shows all of the nested span elements.

What appears as "September 24 at 6:45 AM" is actually StfepltembretSopr 2oo4sacrnsg aut 6a:g4rl5t orefdmeASMsr ·

I.e. extra characters have been inserted in between certain characters of "September 24 at 6:45 AM".

After copying to clipboard and then pasting somewhere, the garbled text is what I see.

enter image description here

It seems like a deliberate attempt to prevent people from copying the datetime of a post. (But copying and pasting from the body of the post is still allowed.)

Why would this be a good practice?

P.S. I'm using Windows Chrome and am logged in to Facebook. When I try via Incognito (logged out), the datetime does not use nested span elements, so copying-and-pasting is not garbled.

4
  • facebook.com/FacebookforDevelopers/posts/10157725187978553 is a public example of a post. When logged out, its datetime copies as "September 29 at 10:08 AM · ". But when logged in, it's StugsSpeptlogemnhrbermero 29cs atre t1c:ort08r hghedanrsPM ·
    – Ryan
    Oct 1, 2020 at 15:10
  • I don't think there's any way to answer this with any certainty without actually asking the team at Facebook. However, since it only appears when logged in, it could be a way of adding a security key to any interaction with that particular post. Oct 3, 2020 at 7:44
  • I think this Q&A site is supposed to help people with best practices. I don't need to know what motivations Facebook in particular had, but if this practice is familiar to someone here, I am curious to know what possible reasons there are for using it. When is it appropriate / helpful?
    – Ryan
    Oct 3, 2020 at 20:14
  • You're getting the same crap when typing a FB comment! Nov 6, 2020 at 2:54

3 Answers 3

2

It's to try to prevent ad-blocking software from distinguishing between the word "Sponsored" on in-line advertisements and the posting date on non-advertisements. The date text is exactly where the word "Sponsored" is shown on ads, but the word "Sponsored" is obfuscated in the same way. (You can almost certainly find the letters S p o n s o r e d in that order scattered in every obfuscated date, and probably a plausible date in every obfuscated "Sponsored".) For a direct link to a post or perhaps for a non-logged in viewer this wouldn't matter, but if you're logged in and scrolling through, then FB really wants you to be able to see the ads. This has been effective in defeating uBlock Origin for several years now (uBlock still blocks the side-bar ads).

2
  • Wow, that's really interesting.
    – Ryan
    Sep 8, 2022 at 18:12
  • 1
    Oh wow, I suppose for a company who's primary source of revenue is ad sales, this level of sophistication in beating ad blockers makes sense. Very interesting. @Ryan, I'd suggest you change the accepted answer to this one—this seems likely to be what's going on here. Sep 9, 2022 at 12:52
2

Note: @Marty White's answer is more likely, in my opinion, to be the actual explanation.

Using the following clues, I'm fairly certain it's an unintended side effect of however they're implementing their internationalization. As you've noticed, this is not helpful, expected, or user-friendly in any way, so it almost certainly is an unpolished result of some implementation detail.

  • As you mention, it doesn't happen when you're logged out, which would make sense, as they probably use a different method for determining how to render dates once they look up your full profile details. Before you're logged in, the method is probably just based on the time zone set in your browser by your OS or checking the general location of your IP. After logging in, it probably uses a dictionary of sorts to present the date in the official format for your exact region set in your profile.

  • The example you provided is not actually the correct, localized date with extra characters mixed in, like you indicated in the question.
    StugsSpeptlogemnhrbermero 29cs atre t1c:ort08r hghedanrsPM
    S ept em ber 29 at 1 : 08 PM
    "September 29 at 1:08 PM"
    September 29 at 1:08 PM = September 29 at 10:08 AM + 3 hours
    The fact that the jumbled mess *mostly* contains the same date, but only offset by a whole number of hours implies that the date representation is being calculated and rendered by the browser, based on the time zone it thinks you're in.

I did not check prior to today, but it works as expected for me this morning. I'm not sure if they've made a change to it's behavior since you opened this question, but I'd be curious to see if you still experience the same issue.

1
0

The question is what would be a reason to scramble posts dates during copy and paste, not what is the reason, just what might be a possible reason. Not everyone understands what a hypothetical scenario is, but purely from a theoretical basis to answer the q it might be worth considering a case in which fb wasn't goldilocks. So, I am not saying any of below is true, just like considering like x=ai+b (imaginary solutions) to a question of what is the root of a quadratic equation where the solution is really known to be real. If that is confusing please stop reading now.

That out of the way, purely hypothetically speaking, what if

(1) FB wanted a semi-monopoly on downloading user's own data, so that you'd need to make a request to them and their software, or a human, could have a chance to edit it as they wished before hand? Hypothetically.

(2) FB wanted to alter dates without people knowing?

(3) FB wanted to de-index some posts they didn't like?

(4) FB feared article theft, where search engine optimization "authors" would use a scraper to copy and paste high quality (some posts can be long on fb and one could use likes and size to get an idea of quality) content from facebook?

(5) FB wanted to know who was copying what?

It's purely hypothetical, but let's say a bad event occurred, and the exact time of some post mattered. You know, like a court case where they ask these sorts of questions. Would #2 give fb more power? Hypothetically? What if the power is just to know that one requested a download of their data, as in having a list of all the users who don't really trust fb to store their data?

Is it really true that the view of someone logged in is the same as the view of someone not logged in, or are the number of visible posts drastically limited for those viewing anonymously?

What features would be helpful in the hypothetical goals #1-#5?

One feature for both might be a non-direct relation between what the user gets when copying text manually (after expanding posts, itself a potentially related "feature") and what the computer saves into say a word document upon a paste command. It would make it more difficult for people from just doing that simple method, and boost the role of making fb be the middle man. There are historical cases where an entity wishes to be the middle man, so it is not as insane as it seems. An exact example is the app called com.mhd.flasher.n54 which allows one to modify some engine parameters. (You have to go online and enter your vin number. You cannot just hack your car without going through the middle man.)

Is that the reason? No idea, but I did think the other answer is not the only possible answer so I wanted to post this one.

What if the other characters might be unique to the copy so that the time of the copy and who did the copy can be known. This is super easy to test of course but I'm lazy and just wanted to post other more creative answers than the "this is a dumb question" (the supreme brilliance of something as shocking as occam's razor, just a glitch) answer sitting here before us now.

1
  • I did not say "this is a dumb question." Jun 23, 2021 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.