We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94f8bab commit ad705f8Copy full SHA for ad705f8
src/js/content.js
@@ -3,6 +3,11 @@ let shiftPressed = false;
3
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
4
5
function pasteHandler(event) {
6
+ // We have to wait until the paste event to detect Discourse.
7
+ if (document.querySelectorAll('.discourse-root').length > 0) {
8
+ return;
9
+ }
10
+
11
if (shiftPressed) {
12
return;
13
}
@@ -186,11 +191,6 @@ if (document.body.classList.contains('o2')) {
186
191
attach = false;
187
192
188
193
189
-// No need to load in Discourse, as it already has this feature.
190
-if (document.querySelectorAll('.discourse-root').length > 0) {
- attach = false;
-}
-
194
if (attach) {
195
document.addEventListener('paste', pasteHandler);
196
document.addEventListener('keydown', shiftChecker);
0 commit comments