Skip to content

Commit 4b86e3d

Browse files
committed
avoid unnecessary mutations check
1 parent ff5d250 commit 4b86e3d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

contentScript.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import { unpack } from 'msgpackr';
22
import { Buffer } from 'buffer';
33

4+
function isQueueDetailsPage() {
5+
const fragment = window.location.hash.substring(1);
6+
const [path, queryString] = fragment.split('?');
7+
return path.startsWith('/queues/') && path.split('/').length >= 2;
8+
}
9+
410
function handleRabbitMQMessageDecoding(mutations) {
11+
if (!isQueueDetailsPage()) {
12+
return;
13+
}
14+
515
mutations.forEach((mutation) => {
616
if (mutation.addedNodes && mutation.addedNodes.length > 0) {
717
if (mutation.target.nodeName != 'DIV') {

0 commit comments

Comments
 (0)