Quora Unblocker

Removes the Quora login requirement and any nagging about it

  1. // ==UserScript==
  2. // @name Quora Unblocker
  3. // @description Removes the Quora login requirement and any nagging about it
  4. // @namespace http://sindresorhus.com
  5. // @version 1.1.0
  6. // @author Sindre Sorhus
  7. // @license MIT
  8. // @released 2013-02-17
  9. // @updated 2019-03-11
  10. // @icon https://github.com/sindresorhus/quora-unblocker-userscript/raw/master/icon.png
  11. // @grant GM_addStyle
  12. // @match *://quora.com/*
  13. // @match *://www.quora.com/*
  14. // @run-at document-start
  15. // ==/UserScript==
  16. (function () {
  17. 'use strict';
  18. var queryString = {};
  19.  
  20. queryString.parse = function (str) {
  21. if (typeof str !== 'string') {
  22. return {};
  23. }
  24.  
  25. str = str.trim().replace(/^(\?|#)/, '');
  26.  
  27. if (!str) {
  28. return {};
  29. }
  30.  
  31. return str.trim().split('&').reduce(function (ret, param) {
  32. var parts = param.replace(/\+/g, ' ').split('=');
  33. var key = parts[0];
  34. var val = parts[1];
  35.  
  36. key = decodeURIComponent(key);
  37. // missing `=` should be `null`:
  38. // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  39. val = val === undefined ? null : decodeURIComponent(val);
  40.  
  41. if (!ret.hasOwnProperty(key)) {
  42. ret[key] = val;
  43. } else if (Array.isArray(ret[key])) {
  44. ret[key].push(val);
  45. } else {
  46. ret[key] = [ret[key], val];
  47. }
  48.  
  49. return ret;
  50. }, {});
  51. };
  52.  
  53. queryString.stringify = function (obj) {
  54. return obj ? Object.keys(obj).map(function (key) {
  55. var val = obj[key];
  56.  
  57. if (Array.isArray(val)) {
  58. return val.map(function (val2) {
  59. return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
  60. }).join('&');
  61. }
  62.  
  63. return encodeURIComponent(key) + '=' + encodeURIComponent(val);
  64. }).join('&') : '';
  65. };
  66.  
  67. if (typeof define === 'function' && define.amd) {
  68. define(function() { return queryString; });
  69. } else if (typeof module !== 'undefined' && module.exports) {
  70. module.exports = queryString;
  71. } else {
  72. window.queryString = queryString;
  73. }
  74. })();
  75.  
  76. (function () {
  77. 'use strict';
  78.  
  79. var query = queryString.parse(location.search);
  80.  
  81. if (!query.share) {
  82. query.share = 1;
  83. location.search = queryString.stringify(query);
  84. return;
  85. }
  86.  
  87. document.addEventListener('DOMContentLoaded', function () {
  88. // silently fails in Firefox if placed outside when `document-start`
  89. GM_addStyle('.LoggedOutSiteHeader, .narrow_signup_form, .signup_bubble, .signup_column, .logged_out .follow_button, .logged_out .ActionBar, .logged_out .AskToAnswerSectionToggle, .logged_out .answer_voters, .logged_out .Footer, .inline_answer_logged_out { display: none !important }');
  90. });
  91. })();