-
Notifications
You must be signed in to change notification settings - Fork 1
/
Quora - Adblock and usability tweaks.user.js
78 lines (71 loc) · 1.99 KB
/
Quora - Adblock and usability tweaks.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// ==UserScript==
// @name Quora - Adblock and usability tweaks
// @namespace https://github.com/adamhotep/userscripts
// @description Bypass login, hold "Still have a question?" below answers
// @include https://www.quora.com/*
// @version 0.3.20221019
// @grant GM_addStyle
// ==/UserScript==
// Greasemonkey 4 removed GM_addStyle here it is again. {{{
if (typeof GM_addStyle == 'undefined') {
function GM_addStyle(aCss) {
'use strict';
let head = document.head;
if (head) {
let style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.textContent = aCss;
head.appendChild(style);
return style;
}
return null;
}
}
// }}}
gray_light = document.querySelectorAll(`.q-box > .qu-color--gray_light`);
if (gray_light) {
gray_light.forEach(ad => {
if (ad?.innerText.match(/^Ad\sby\s/)) {
let prev = null, prev2 = null;
while (ad?.id != "mainContent") {
prev2 = prev;
prev = ad;
ad = ad.parentElement;
if (ad == document.body) { prev2 = null; break; } // too far
}
if (typeof prev2?.style.display == "string") {
prev2.style.display = "none";
}
}
});
}
// disabled older bypass for login
//GM_addStyle(`
void(`
/* remove login dialog, enable scrolling, un-blur page */
div[id$="_signup_wall_wrapper"] {
display:none;
}
.signup_wall_prevent_scroll {
overflow:initial;
}
.signup_wall_prevent_scroll .SiteHeader,
.signup_wall_prevent_scroll .LoggedOutFooter,
.signup_wall_prevent_scroll .ContentWrapper {
filter:none;
}
/* Push "Still have a question" prompt below answers */
div.BelowQuestionAddPrompt[id$="_question_prompt"] {
position:initial!important;
}
/* In the event you want to float the "Still have a question" dialog:
div.BelowQuestionAddPrompt[id$="_question_prompt"]:not(:hover) {
display:inherit;
max-height:5ex;
left:0;
max-width:21.5ex;
white-space:nowrap;
overflow-x:hidden;
}
*/
`);