Skip to content

Commit

Permalink
fix: new title tag causing unexpected error (#34)
Browse files Browse the repository at this point in the history
Grammarly changed the element which renders the title. This changes the querySelector according to the new pattern.
  • Loading branch information
povilasv authored Oct 31, 2022
1 parent efc5dbf commit 73b0f6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/content.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
const title = document.querySelector("input[name=header-title-input]");
const title = document.querySelector("[data-name=header-title-input]");
if (!title) {
return sendResponse({ error: "Error while getting the title" });
}
Expand All @@ -10,7 +10,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
}

return sendResponse({
title: title.value,
title: title.textContent,
content: content.innerHTML,
});
});

0 comments on commit 73b0f6a

Please sign in to comment.