Skip to content

Instantly share code, notes, and snippets.

@nathggns
Created April 4, 2019 15:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathggns/bbf3e6d0b05cca360b458dcd98e068d4 to your computer and use it in GitHub Desktop.
Save nathggns/bbf3e6d0b05cca360b458dcd98e068d4 to your computer and use it in GitHub Desktop.
Break into Twitter's A/B test of their new website

Twitter has started testing a new desktop website based on their mobile website that should be a faster experience.

If you're not lucky enough to be included in this A/B test, you can "break" into it by setting the rweb_optin cookie to on.

You can do that by pasting the following URL into your browser's address bar while you're logged-in on https://twitter.com.

javascript:document.cookie%3D'rweb_optin%3Don%3B%20expires%3D01%2F12%2F2019%3B%20path%3D%2F%3B'%3Bwindow.location.reload()%3B

Safari

Safari might prevent you from pasting javascript into the URL bar. In which case, you need to enable that feature.

Firstly, turn on developer mode in Safari's advanced preferences – "Show Develop menu in menu bar". Then, under the Develop menu, check "Allow JavaScript from Smart Search field".

Security

If you're concerned about pasting arbitrary javascript into your browser, that URL was produced by the following code

`javascript:${encodeURIComponent("document.cookie='rweb_optin=on; expires=01/12/2019; path=/;';window.location.reload();")}`;

And it simply runs the following javascript

document.cookie='rweb_optin=on; expires=01/12/2019; path=/;';
window.location.reload();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment