Skip to content

Commit ad705f8

Browse files
committed
Fix Discourse support.
1 parent 94f8bab commit ad705f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/js/content.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ let shiftPressed = false;
33
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
44

55
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+
611
if (shiftPressed) {
712
return;
813
}
@@ -186,11 +191,6 @@ if (document.body.classList.contains('o2')) {
186191
attach = false;
187192
}
188193

189-
// No need to load in Discourse, as it already has this feature.
190-
if (document.querySelectorAll('.discourse-root').length > 0) {
191-
attach = false;
192-
}
193-
194194
if (attach) {
195195
document.addEventListener('paste', pasteHandler);
196196
document.addEventListener('keydown', shiftChecker);

0 commit comments

Comments
 (0)