diff --git a/extension/content.js b/extension/content.js
index d6780fd..5de00e5 100644
--- a/extension/content.js
+++ b/extension/content.js
@@ -64,12 +64,31 @@
}
function getCmsContentType() {
- const el = document.querySelector(".navbar-inner .decisionAreaLabel");
- const raw = el ? String(el.textContent || "").trim().toLowerCase() : "";
+ // Try the old selector first (for backwards compatibility)
+ let el = document.querySelector(".navbar-inner .decisionAreaLabel");
+ if (el) {
+ const raw = String(el.textContent || "").trim().toLowerCase();
+ if (raw.includes("image")) return "Image";
+ if (raw.includes("profile")) return "Profile";
+ if (raw.includes("question")) return "Question";
+ return "Default";
+ }
+
+ // New selector: find
contentType and get the next sibling
+ const dtElements = document.querySelectorAll("dt");
+ for (const dt of dtElements) {
+ if (dt.textContent.trim().toLowerCase() === "contenttype") {
+ const dd = dt.nextElementSibling;
+ if (dd && dd.tagName === "DD") {
+ const raw = String(dd.textContent || "").trim().toLowerCase();
+ if (raw.includes("image")) return "Image";
+ if (raw.includes("profile")) return "Profile";
+ if (raw.includes("question")) return "Question";
+ }
+ break;
+ }
+ }
- if (raw.includes("image")) return "Image";
- if (raw.includes("profile")) return "Profile";
- if (raw.includes("question")) return "Question";
return "Default";
}
diff --git a/extension/matcher-core.js b/extension/matcher-core.js
index a4bdfb3..c854ae0 100644
--- a/extension/matcher-core.js
+++ b/extension/matcher-core.js
@@ -114,12 +114,15 @@
if (prev === " " && next === " ") {
result += "[^\\s]+";
} else if (isFirst || isLast) {
- result += "[^\\s\\p{P}]*";
+ // Allow apostrophes (straight and curly) for contractions like "didn't"
+ result += "(?:[^\\s\\p{P}]|['''])*";
} else {
- result += "[^\\s\\p{P}]*?";
+ // Middle wildcard: non-greedy, allow apostrophes
+ result += "(?:[^\\s\\p{P}]|['''])*?";
}
} else if (ch === "?") {
- result += "[\\s\\S]";
+ // Single char wildcard - also allow apostrophes
+ result += "(?:[^\\s\\p{P}]|['''])";
} else if (ch === " ") {
result += "\\s+";
} else {
diff --git a/tools/matcher.js b/tools/matcher.js
index b549d6e..159c376 100644
--- a/tools/matcher.js
+++ b/tools/matcher.js
@@ -110,12 +110,15 @@ function globToRegexFragment(pattern) {
if (prev === " " && next === " ") {
result += "[^\\s]+";
} else if (isFirst || isLast) {
- result += "[^\\s\\p{P}]*";
+ // Allow apostrophes (straight and curly) for contractions like "didn't"
+ result += "(?:[^\\s\\p{P}]|['''])*";
} else {
- result += "[^\\s\\p{P}]*?";
+ // Middle wildcard: non-greedy, allow apostrophes
+ result += "(?:[^\\s\\p{P}]|['''])*?";
}
} else if (ch === "?") {
- result += "[\\s\\S]";
+ // Single char wildcard - also allow apostrophes
+ result += "(?:[^\\s\\p{P}]|['''])";
} else if (ch === " ") {
result += "\\s+";
} else {