Thursday, November 1, 2012

Disable +1 buttons in Google Reader

Reload Reader or mark an item as read (so that the command token gets refreshed) and then run the following in the DevTools console:

var xhr = new XMLHttpRequest();
xhr.onload = function() {
  console.log(xhr.status);
};
xhr.onerror = function() {
  console.log('error');
};

var params = '';
function addParam(name, value) {
  if (params) {
    params += '&';
  }
  params += encodeURIComponent(name) + '=' + encodeURIComponent(value);
}

addParam('T', _COMMAND_TOKEN);
addParam('k', 'item-actions');
addParam('v', '{"plusone-action": false, "share-action": true, "email-action": true, "tags-action": true}');

xhr.open('POST', '/reader/api/0/preference/set');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(params);

Once you see 200 printed, you can reload Reader, and the +1 buttons should be gone.

To reset things back to the way they were, change the 'v' value to '{}'.